fix(input): keep AYN system key out of Home shortcuts (#1643)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-26 21:11:46 -04:00
1 parent bb9a64fa5f
commit 8749154cbf
2 files changed
+16 -1

No files matched your search

@@ -84,6 +84,20 @@ class PadBridgeRoutingTest {
assertFalse(PadBridge.anyControllerConnected())
}
@Test fun homeShortcutsIgnoreHomeFromSystemKeys() {
val gpio = device(InputDevice.SOURCE_KEYBOARD, InputDevice.KEYBOARD_TYPE_NON_ALPHABETIC, name = "gpio-keys")
val pad = device(InputDevice.SOURCE_GAMEPAD or InputDevice.SOURCE_KEYBOARD, InputDevice.KEYBOARD_TYPE_NON_ALPHABETIC)
assertFalse(PadBridge.isControllerKeyEvent(key(gpio, KeyEvent.KEYCODE_HOME, KeyEvent.ACTION_DOWN)))
assertTrue(PadBridge.isControllerKeyEvent(key(pad, KeyEvent.KEYCODE_HOME, KeyEvent.ACTION_DOWN)))
val owner = Any()
HomeButtonShortcuts.attach(owner, { true }, { fail("system Home must not press Guide") }, {})
try {
for (action in listOf(KeyEvent.ACTION_DOWN, KeyEvent.ACTION_UP)) {
assertFalse(HomeButtonShortcuts.onKeyEvent(RuntimeEnvironment.getApplication(), key(gpio, KeyEvent.KEYCODE_HOME, action)))
}
} finally { HomeButtonShortcuts.detach(owner) }
}
@Test fun keyAndMotionOwnershipDoesNotFollowEverySourceOnTheDevice() {
val keyboard = device(InputDevice.SOURCE_KEYBOARD, InputDevice.KEYBOARD_TYPE_ALPHABETIC)
val composite = device(COMPOSITE, InputDevice.KEYBOARD_TYPE_ALPHABETIC)