Skip to content

Commit

Permalink
[Keyboard, Android] Mint physical keys on the Android plane (flutter#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwingsmt authored Jun 21, 2022
1 parent 39f0501 commit 2111dd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private Long getPhysicalKey(@NonNull KeyEvent event) {
// 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,5 @@ public static TogglingGoal[] getTogglingGoals() {

public static final long kValueMask = 0x000ffffffffL;
public static final long kUnicodePlane = 0x00000000000L;
public static final long kLogicalPlane = 0x00300000000L;
public static final long kAndroidPlane = 0x01100000000L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public void tapUpperA() {
}

@Test
public void eventsWithForgedCodes() {
public void eventsWithMintedCodes() {
final KeyboardTester tester = new KeyboardTester();
final ArrayList<CallRecord> calls = new ArrayList<>();

Expand All @@ -814,7 +814,7 @@ public void eventsWithForgedCodes() {
verifyEmbedderEvents(
calls,
new KeyData[] {
buildKeyData(Type.kDown, 0x300000042L, LOGICAL_ENTER, "\n", false),
buildKeyData(Type.kDown, 0x1100000042L, LOGICAL_ENTER, "\n", false),
});
calls.clear();

Expand Down

0 comments on commit 2111dd5

Please sign in to comment.