Use keycodes for UWP xbox instead of gamepadtokey.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user