Skip to content

Commit d45bba9

Browse files
committed
Fix "a" key always being as as a keyup
We were using an empty value on the second byte of the ADB keyboard register 0, but that maps to the "a" key. This manifested itself as the Key Caps DA never showing the "a" key as being down. Switch to a non-existent key for the second byte.
1 parent 931060d commit d45bba9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

devices/common/adb/adbkeyboard.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ bool AdbKeyboard::get_register_0() {
6161
out_buf[0] = (this->key_state << 7) | (this->key & 0x7F);
6262
// It's possible that we get two events before the host polls us, but
6363
// in practice it has not come up. We need to set the key status bit to
64-
// 1 (released), otherwise if we leave it empty, the host will think
65-
// that the a key (code 0) is pressed.
66-
out_buf[1] = 1 << 7;
64+
// 1 (released), and the key to a non-existent one (0x7F). Otherwise if
65+
// we leave it empty, the host will think that the 'a' key (code 0) is
66+
// pressed.
67+
out_buf[1] = 0xFF;
6768

6869
this->key = 0;
6970
this->key_state = 0;

0 commit comments

Comments
 (0)