Merge pull request #64 from mihaip/upstream-a-key

Fix "a" key always being as as a keyup
This commit is contained in:
Maxim Poliakovski 2023-11-24 11:35:18 +01:00 committed by GitHub
commit d37d83c5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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