Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added keycodes for swapping and unswapping the Control and OS keys #6110

Merged
merged 17 commits into from
Aug 22, 2019

Conversation

1hella
Copy link
Contributor

@1hella 1hella commented Jun 9, 2019

Description

Key codes to swap and unswap the control and windows/cmd keys.

I was looking for this feature to have the ctrl key in the caps lock spot in my HHKB layout for when I'm on Windows, and to have the CMD key there when I moved to MacOS. I saw there are keycodes to swap some of the other keys so I adapted the logic to do the same thing with the Control and OS keys.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

  • None

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes. (not sure where to do that)
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Key codes to swap and unswap the control and windows/cmd keys
docs/keycodes.md Outdated Show resolved Hide resolved
quantum/keycode_config.h Outdated Show resolved Hide resolved
Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end
Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you expanded the keycode_config function to handle this functionality.

However, could you make sure that the appropriate handling is added to mod_config as well.

quantum/quantum_keycodes.h Outdated Show resolved Hide resolved
quantum/quantum_keycodes.h Outdated Show resolved Hide resolved
@drashna
Copy link
Member

drashna commented Jun 13, 2019

In addition to the mod_config option, could you also add a "both left and right" keycode for the swap, unswap and toggle?

@1hella
Copy link
Contributor Author

1hella commented Jun 13, 2019

@drashna sure will add both of those

@drashna
Copy link
Member

drashna commented Jun 17, 2019

Any updates on this?

@1hella
Copy link
Contributor Author

1hella commented Jun 18, 2019

@drashna Sorry I’ve been pretty busy. Will have time to work on it more tonight 👍

@drashna
Copy link
Member

drashna commented Jun 18, 2019

Okay, just wanted to follow up on this. :)

@drashna
Copy link
Member

drashna commented Jun 18, 2019

I don't know why it's not showing in the webui here, but it looks like the conflict is in the enum for the keycodes. Right before SAFE_RANGE.

You may need to update/rebase your branch to fix the merge conflict.

docs/feature_bootmagic.md Outdated Show resolved Hide resolved
docs/feature_bootmagic.md Outdated Show resolved Hide resolved
docs/feature_bootmagic.md Outdated Show resolved Hide resolved
docs/feature_bootmagic.md Outdated Show resolved Hide resolved
1hella and others added 4 commits August 20, 2019 02:14
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@drashna drashna merged commit d534c72 into qmk:master Aug 22, 2019
@1hella
Copy link
Contributor Author

1hella commented Aug 22, 2019

@drashna 😍

@ninjonas
Copy link
Contributor

To whom it may concern;

Long time user, first time poster. Recently merged master onto my repo and noticed the my LCTRL stopped working. After some digging, noticed this code was added .
I have a Lily58 and this is my keymap. My LCTRL is set up like this: LALT, LGUI, LCTRL See ninjonas.h

I don't have bootmagic enabled and yet this affecting my LCTRL key. Current workaround is comment out the keycode_config.c Line 36-44. Not the correct solution and need your expert advice.

Thanks

@fauxpark
Copy link
Member

@ninjonas yeah, this is a known problem, please see #6589. In a nutshell, reset your EEPROM :)

@ninjonas
Copy link
Contributor

@fauxpark - Thank you for the quick response! Reseting the EEPROM did the trick!

drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Aug 27, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
fdidron pushed a commit to zsa/qmk_firmware that referenced this pull request Aug 28, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
doughsay pushed a commit to doughsay/qmk_firmware that referenced this pull request Aug 31, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
swanmatch pushed a commit to swanmatch/qmk_firmware that referenced this pull request Sep 3, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
fdidron pushed a commit to zsa/qmk_firmware that referenced this pull request Sep 5, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
ripxorip pushed a commit to ripxorip/qmk_firmware that referenced this pull request Dec 3, 2019
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
ridingqwerty pushed a commit to ridingqwerty/qmk_firmware that referenced this pull request Jan 10, 2020
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
@1hella 1hella deleted the magic_swap_ctrl_gui branch November 9, 2020 21:46
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
…mk#6110)

* Add MAGIC_SWAP_CONTROL_LGUI and MAGIC_UNSWAP_CONTROL_LGUI keycodes

Key codes to swap and unswap the control and windows/cmd keys

* Fix issues with pull request qmk#6110

Renamed swap/unswap lctl and lgui key codes, added key codes to swap/unswap rctl and rgui, and moved new bool inside keycode_config.h struct to the end

* Move new keycodes to the end of the enum (qmk#6110)

* add cases for swapped control and OS keys to mod_config (qmk#6110)

* Add new keycodes to feature_bootmagic.md (qmk#6110)

* Add R+L swap codes to keep in parity with AG_* codes

* Extend Magic range check to include new magic codes

* Update audio docs

* Combine 2 byte ranges into 1 word for EECONFG

Fix names for Keymap config EEPROM

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Update docs/feature_bootmagic.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants