mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-24 09:21:48 +00:00
Fixed hotkeys not working with shift + number
This commit is contained in:
parent
df432e45ef
commit
791c0c4111
1 changed files with 5 additions and 1 deletions
|
@ -44,6 +44,8 @@ export type GenericHotkey = Replace<
|
|||
}
|
||||
>;
|
||||
|
||||
const uppercaseNumbers = [")", "!", "@", "#", "$", "5", "^", "&", "*", "("];
|
||||
|
||||
export function createHotkey<T extends HotkeyOptions>(
|
||||
optionsFunc: OptionsFunc<T, BaseHotkey, GenericHotkey>
|
||||
): Hotkey<T> {
|
||||
|
@ -79,7 +81,9 @@ document.onkeydown = function (e) {
|
|||
return;
|
||||
}
|
||||
let key = e.key;
|
||||
if (e.shiftKey) {
|
||||
if (uppercaseNumbers.includes(key)) {
|
||||
key = "shift+" + uppercaseNumbers.indexOf(key);
|
||||
} else if (e.shiftKey) {
|
||||
key = "shift+" + key;
|
||||
}
|
||||
if (e.ctrlKey) {
|
||||
|
|
Loading…
Reference in a new issue