Closed Andrew67 closed 3 years ago
Interesting. I can reproduce this on my mac with Firefox, although to be honest, it's not much of an inconvenience. The number of people who use Genshin Schedule on a macOS Firefox with numpad keys is probably very, very low.
But if you intend to fix this and submit a PR anyway, I will definitely have a look!
Ready! https://github.com/chiyadev/genshin-schedule/pull/56 Tested on Firefox/Edge on macOS
(I fully intend to submit a PR for this but as I'll explain below it's not currently possible)
This issue appears to be a perfect storm of:
event.code
orevent.which
instead ofevent.key
for key handlers (which is what hotkeys JS does)If you happen to have such a device on macOS you can test it out here: https://omatsuri.app/events-keycode
Basically, for e.g. 4, the top row key returns:
key: '4', code: 'Digit4', which: 52
but the numeric keypad returns (I think this matches NumLock off on Windows but macOS does not do NumLock):key: '4', code: 'Numpad4', which: 100
Furthermore, Chrome seems to pave over this difference and returns the same as the top row key above, so it is left as a Firefox issue.Solution:
4
becomes4, num_4
for example)