[Keyboard, Android] Mint physical keys on the Android plane (flutter/engine#34122)
This commit is contained in:
@@ -72,7 +72,7 @@ public class KeyEmbedderResponder implements KeyboardManager.Responder {
|
||||
// key from the key code so that keys can be told apart.
|
||||
if (scancode == 0) {
|
||||
// The key code can't also be 0, since those events have been filtered.
|
||||
return keyOfPlane(event.getKeyCode(), KeyboardMap.kLogicalPlane);
|
||||
return keyOfPlane(event.getKeyCode(), KeyboardMap.kAndroidPlane);
|
||||
}
|
||||
final Long byMapping = KeyboardMap.scanCodeToPhysical.get(scancode);
|
||||
if (byMapping != null) {
|
||||
|
||||
@@ -614,6 +614,5 @@ public class KeyboardMap {
|
||||
|
||||
public static final long kValueMask = 0x000ffffffffL;
|
||||
public static final long kUnicodePlane = 0x00000000000L;
|
||||
public static final long kLogicalPlane = 0x00300000000L;
|
||||
public static final long kAndroidPlane = 0x01100000000L;
|
||||
}
|
||||
|
||||
@@ -799,7 +799,7 @@ public class KeyboardManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void eventsWithForgedCodes() {
|
||||
public void eventsWithMintedCodes() {
|
||||
final KeyboardTester tester = new KeyboardTester();
|
||||
final ArrayList<CallRecord> calls = new ArrayList<>();
|
||||
|
||||
@@ -814,7 +814,7 @@ public class KeyboardManagerTest {
|
||||
verifyEmbedderEvents(
|
||||
calls,
|
||||
new KeyData[] {
|
||||
buildKeyData(Type.kDown, 0x300000042L, LOGICAL_ENTER, "\n", false),
|
||||
buildKeyData(Type.kDown, 0x1100000042L, LOGICAL_ENTER, "\n", false),
|
||||
});
|
||||
calls.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user