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

Deduplicate international keys #1030

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions docs/en/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,31 +155,6 @@
|`KC.RIGHT_ANGLE_BRACKET`|`KC.RABK` |`>` |
|`KC.QUESTION` |`KC.QUES` |`?` |

## [International Keys]

|Key |Aliases |Description |
|------------------------|------------------------------|-----------------------|
|`KC.NONUS_HASH` |`KC.NUHS` |ISO Left of Return |
|`KC.NONUS_BSLASH` |`KC.NUBS` |ISO Right of LSHIFT |
|`KC.APPLICATION` |`KC.APP`,`KC.SEL`,`KC.WINMENU`|Menu Key (Near RCTRL) |
|`KC.INT1` |`KC.RO` | |
|`KC.INT2` |`KC.KANA` | |
|`KC.INT3` |`KC.JYEN` | |
|`KC.INT4` |`KC.HENK` | |
|`KC.INT5` |`KC.MHEN` | |
|`KC.INT6` | | |
|`KC.INT7` | | |
|`KC.INT8` | | |
|`KC.INT9` | | |
|`KC.LANG1` |`HAEN` | |
|`KC.LANG2` |`HAEJ` | |
|`KC.LANG3` | | |
|`KC.LANG4` | | |
|`KC.LANG5` | | |
|`KC.LANG6` | | |
|`KC.LANG7` | | |
|`KC.LANG8` | | |
|`KC.LANG9` | | |

## [Internal Keys]

Expand Down Expand Up @@ -217,6 +192,8 @@
|`KC.BT_NEXT_CONN` |`KC.BT_NXT` |Selects the next BT connection |
|`KC.BT_PREV_CONN` |`KC.BT_PRV` |Selects the previous BT connection|

## [International Keys]
See [International extension](international.md).

## [Media Keys]
See [MediaKeys extension](media_keys.md).
32 changes: 0 additions & 32 deletions kmk/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,36 +285,6 @@ def maybe_make_shifted_key(candidate: str) -> Optional[Key]:
)


def maybe_make_international_key(candidate: str) -> Optional[Key]:
codes = (
(50, ('NONUS_HASH', 'NUHS')),
(100, ('NONUS_BSLASH', 'NUBS')),
(101, ('APP', 'APPLICATION', 'SEL', 'WINMENU')),
(135, ('INT1', 'RO')),
(136, ('INT2', 'KANA')),
(137, ('INT3', 'JYEN')),
(138, ('INT4', 'HENK')),
(139, ('INT5', 'MHEN')),
(140, ('INT6',)),
(141, ('INT7',)),
(142, ('INT8',)),
(143, ('INT9',)),
(144, ('LANG1', 'HAEN')),
(145, ('LANG2', 'HAEJ')),
(146, ('LANG3',)),
(147, ('LANG4',)),
(148, ('LANG5',)),
(149, ('LANG6',)),
(150, ('LANG7',)),
(151, ('LANG8',)),
(152, ('LANG9',)),
)

for code, names in codes:
if candidate in names:
return make_key(names=names, constructor=KeyboardKey, code=code)


def maybe_make_firmware_key(candidate: str) -> Optional[Key]:
keys = (
((('BLE_REFRESH',), handlers.ble_refresh)),
Expand Down Expand Up @@ -364,8 +334,6 @@ def maybe_make_firmware_key(candidate: str) -> Optional[Key]:
# sending Shift+(whatever key is normally pressed) to get these, so
# for example `KC_AT` will hold shift and press 2.
maybe_make_shifted_key,
# International
maybe_make_international_key,
)


Expand Down