Skip to content

Commit

Permalink
android: add missing Back button key event
Browse files Browse the repository at this point in the history
  • Loading branch information
rsx authored and not-fl3 committed Sep 15, 2024
1 parent 27cade5 commit 76ef7ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ pub enum KeyCode {
RightAlt = 0xffea,
RightSuper = 0xffec,
Menu = 0xff67,
// Android back button
Back = 0xff04,
Unknown = 0x01ff,
}

Expand Down
1 change: 1 addition & 0 deletions src/native/android/keycodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub fn translate_keycode(keycode: u32) -> KeyCode {
0x01 => KeyCode::Left,
0x02 => KeyCode::Right,
0x03 => KeyCode::Home,
0x04 => KeyCode::Back,
0x07 => KeyCode::Key0,
0x08 => KeyCode::Key1,
0x09 => KeyCode::Key2,
Expand Down

0 comments on commit 76ef7ac

Please sign in to comment.