Use keycodes for UWP xbox instead of gamepadtokey.

This commit is contained in:
Bradley Eaton
2025-06-24 13:27:19 +01:00
parent 42c71dcb97
commit a7d443ab23
6 changed files with 73 additions and 3 deletions
+2 -1
View File
@@ -79,7 +79,8 @@ function onMouseDown(e) {
}
function onKeyDown(e) {
if (e.keyCode === 13 && !enableNativeMenu()) {
// Xbox controller for UWP WebView2 uses keycode 195 to select.
if (e.keyCode === 13 && !enableNativeMenu() || (e.keyCode === 195 && browser.edgeChromium)) {
e.preventDefault();
showActionSheet(this);
}
+6
View File
@@ -527,12 +527,18 @@ 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));