From 589bf37829cadb0e4595fd97a2d6094a6471e985 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 30 Jan 2016 21:31:27 +0200 Subject: [PATCH] Support some additional keys In particular, the standard keys on Android devices are now supported. --- source/input/android/keys.cpp | 2 +- source/input/keys.h | 3 +++ source/input/x11/keys.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/input/android/keys.cpp b/source/input/android/keys.cpp index a96df8b..0ed9051 100644 --- a/source/input/android/keys.cpp +++ b/source/input/android/keys.cpp @@ -41,7 +41,7 @@ unsigned sys_keymap[N_KEYS_] = AKEYCODE_NUMPAD_0, AKEYCODE_NUMPAD_1, AKEYCODE_NUMPAD_2, AKEYCODE_NUMPAD_3, AKEYCODE_NUMPAD_4, AKEYCODE_NUMPAD_5, AKEYCODE_NUMPAD_6, AKEYCODE_NUMPAD_7, AKEYCODE_NUMPAD_8, AKEYCODE_NUMPAD_9, AKEYCODE_NUMPAD_ADD, AKEYCODE_NUMPAD_SUBTRACT, AKEYCODE_NUMPAD_MULTIPLY, AKEYCODE_NUMPAD_DIVIDE, AKEYCODE_NUMPAD_DOT, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, AKEYCODE_MENU, AKEYCODE_BACK, AKEYCODE_VOLUME_UP, AKEYCODE_VOLUME_DOWN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/source/input/keys.h b/source/input/keys.h index 7d4822c..2cc42ce 100644 --- a/source/input/keys.h +++ b/source/input/keys.h @@ -137,6 +137,9 @@ enum KEY_PAUSE = 0xE0, KEY_PRINT_SCREEN, KEY_MENU, + KEY_BACK, + KEY_VOLUME_UP, + KEY_VOLUME_DOWN, N_KEYS_ = 0x100 }; diff --git a/source/input/x11/keys.cpp b/source/input/x11/keys.cpp index 77cd95d..1f0e509 100644 --- a/source/input/x11/keys.cpp +++ b/source/input/x11/keys.cpp @@ -1,4 +1,5 @@ #include +#include #include "keys.h" namespace Msp { @@ -41,7 +42,7 @@ unsigned sys_keymap[N_KEYS_] = XK_KP_0, XK_KP_1, XK_KP_2, XK_KP_3, XK_KP_4, XK_KP_5, XK_KP_6, XK_KP_7, XK_KP_8, XK_KP_9, XK_KP_Add, XK_KP_Subtract, XK_KP_Multiply, XK_KP_Divide, XK_KP_Separator, 0, - XK_Pause, XK_Print, XK_Menu, 0, 0, 0, 0, 0, + XK_Pause, XK_Print, XK_Menu, 0, XF86XK_AudioRaiseVolume, XF86XK_AudioLowerVolume, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -- 2.45.2