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

Allow 32 total User Defined Custom Keycodes #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions src/utils/key-to-byte.json5
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,22 @@
USER13: 0x5f8d,
USER14: 0x5f8e,
USER15: 0x5f8f,
USER16: 0x5f90,
USER17: 0x5f91,
USER18: 0x5f92,
USER19: 0x5f93,
USER20: 0x5f94,
USER21: 0x5f95,
USER22: 0x5f96,
USER23: 0x5f97,
USER24: 0x5f98,
USER25: 0x5f99,
USER26: 0x5f9a,
USER27: 0x5f9b,
USER28: 0x5f9c,
USER29: 0x5f9d,
USER30: 0x5f9e,
USER31: 0x5f9f,

// Hard-coded aliases for LT(layer,KC_SPC)
SPC_FN1: 0x412c,
Expand Down
18 changes: 17 additions & 1 deletion src/utils/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function shorten(str: string) {
}

export function isUserKeycodeByte(byte: number) {
return byte >= basicKeyToByte.USER00 && byte <= basicKeyToByte.USER15;
return byte >= basicKeyToByte.USER00 && byte <= basicKeyToByte.USER31;
}

export function getUserKeycodeIndex(byte: number) {
Expand Down Expand Up @@ -1316,6 +1316,22 @@ export function getKeycodes(): IKeycodeMenu[] {
{name: 'User13', code: 'USER13', title: 'Custom Keycode 13'},
{name: 'User14', code: 'USER14', title: 'Custom Keycode 14'},
{name: 'User15', code: 'USER15', title: 'Custom Keycode 15'},
{name: 'User16', code: 'USER16', title: 'Custom Keycode 16'},
{name: 'User17', code: 'USER17', title: 'Custom Keycode 17'},
{name: 'User18', code: 'USER18', title: 'Custom Keycode 18'},
{name: 'User19', code: 'USER19', title: 'Custom Keycode 19'},
{name: 'User20', code: 'USER20', title: 'Custom Keycode 20'},
{name: 'User21', code: 'USER21', title: 'Custom Keycode 21'},
{name: 'User22', code: 'USER22', title: 'Custom Keycode 22'},
{name: 'User23', code: 'USER23', title: 'Custom Keycode 23'},
{name: 'User24', code: 'USER24', title: 'Custom Keycode 24'},
{name: 'User25', code: 'USER25', title: 'Custom Keycode 25'},
{name: 'User26', code: 'USER26', title: 'Custom Keycode 26'},
{name: 'User27', code: 'USER27', title: 'Custom Keycode 27'},
{name: 'User28', code: 'USER28', title: 'Custom Keycode 28'},
{name: 'User29', code: 'USER29', title: 'Custom Keycode 29'},
{name: 'User30', code: 'USER30', title: 'Custom Keycode 30'},
{name: 'User31', code: 'USER31', title: 'Custom Keycode 31'},
],
},
];
Expand Down