Use keyboard key names for navigation on controller.

This commit is contained in:
Bradley Eaton
2025-06-30 16:07:37 +01:00
parent a7d443ab23
commit eff4ca2f19
5 changed files with 20 additions and 56 deletions
-6
View File
@@ -527,18 +527,12 @@ function stepKeyboard(elem, delta) {
*/
function onKeyDown(e) {
switch (keyboardnavigation.getKeyName(e)) {
case 'NavigationLeft':
case 'GamepadDPadLeft':
case 'GamepadLeftThumbLeft':
case 'ArrowLeft':
case 'Left':
stepKeyboard(this, -normalizeSliderStep(this, this.keyboardStepDown));
e.preventDefault();
e.stopPropagation();
break;
case 'NavigationRight':
case 'GamepadDPadRight':
case 'GamepadLeftThumbRight':
case 'ArrowRight':
case 'Right':
stepKeyboard(this, normalizeSliderStep(this, this.keyboardStepUp));