From 897b803d55a33b942b89cf87678cd034b776f247 Mon Sep 17 00:00:00 2001 From: rsx Date: Sun, 15 Sep 2024 16:08:08 +0200 Subject: [PATCH] android: add missing Back button key event --- src/event.rs | 2 ++ src/native/android/keycodes.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/event.rs b/src/event.rs index a702f86c..f5af438c 100644 --- a/src/event.rs +++ b/src/event.rs @@ -139,6 +139,8 @@ pub enum KeyCode { RightAlt = 0xffea, RightSuper = 0xffec, Menu = 0xff67, + // Android back button + Back = 0xff04, Unknown = 0x01ff, } diff --git a/src/native/android/keycodes.rs b/src/native/android/keycodes.rs index 98814a0e..94235374 100644 --- a/src/native/android/keycodes.rs +++ b/src/native/android/keycodes.rs @@ -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,