Skip to content

Commit

Permalink
misc: add keybindings for numpad keys (fixes 71#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed May 5, 2022
1 parent 1bd3a7c commit da1682b
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 39 deletions.
2 changes: 1 addition & 1 deletion meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export const specialCharacterMapping = {
/**
* RegExp for keys of `specialCharacterMapping`.
*/
export const specialCharacterRegExp = /[~!@#$%^&*()_+{}|:"<>?]/g;
export const specialCharacterRegExp = /[~!@#$%^&*()+{}|:"<>?]|(?<!NumPad)_/g;

/**
* Async wrapper around the `glob` package.
Expand Down
9 changes: 8 additions & 1 deletion package.build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,14 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
keybindings: (() => {
const keybindings = modules.flatMap((module) => module.keybindings),
alphanum = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"],
keysToAssign = new Set([...alphanum, ...alphanum.map((x) => `Shift+${x}`), ...",'"]);
keysToAssign = new Set([
...alphanum,
...alphanum.map((x) => `Shift+${x}`),
...",'-",
"Shift+=",
"NumPad_Add",
"NumPad_Subtract",
]);

for (const keybinding of keybindings) {
keysToAssign.delete(keybinding.key);
Expand Down
128 changes: 128 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da1682b

Please sign in to comment.