Closed jessegreenberg closed 1 year ago
Is this because of different key codes? Can we just add support for that key code too?
Testing a vanilla HTML slider, when num on, the number pad does nothing. When num lock is of, the number pad moves the slider.
Event.code for the num pad looks like Numpad7
. There is no meta information on the event to determine if num lock is on.
Event.key accurately describes what is pressed. When Num Lock is on, we get 7
. When Num Lock is off we get Home
. Is it OK if we use Event.key
for numpad keys?
Or we can just add numpad Event.codes to AccessibleValueHandler and have them always modify the slider. That is easier but a little less standard.
The code is Numpad7. Is that standard for Home behavior? If we can feel confident saying something like NUM_PAD_HOME: 'Numpad7
in KeyboardUtils, then I think that is preferrable.
OK, a fix was pushed in the above commit. @zepumph and I looked at it together and I tested it on my Windows 10 machine with my numpad. @zepumph over to you, to cherry pick and verify in the next release.
Looks great, let's reopen if QA has trouble in the sim-specific issue.
Specifically, page up/page down/home/end are acting like normal arrow keys. This is not an issue for typical range sliders on the web, so it is a problem with AccessibleValueHandler and the way it responds to key presses.
From https://github.com/phetsims/ratio-and-proportion/issues/542.