From 4aa98c376b76f15a479901ce9402fff6314c58ca Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 13 Sep 2017 12:49:22 +0100 Subject: [PATCH 3/6] ui: add multimedia keys RH-Author: Gerd Hoffmann Message-id: <20170913124925.17637-4-kraxel@redhat.com> Patchwork-id: 76337 O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 3/6] ui: add multimedia keys Bugzilla: 1482388 RH-Acked-by: Dr. David Alan Gilbert RH-Acked-by: John Snow RH-Acked-by: Miroslav Rezanina Add multimedia keys to QKeyCodes and to the keymaps. Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Blake Message-id: 20170726152918.11995-5-kraxel@redhat.com (cherry picked from commit 37810e80553c19f0dac3644924895a9bf5c70785) Signed-off-by: Danilo C. L. de Paula --- qapi-schema.json | 28 +++++++++++++++++++++++++++- ui/input-keymap.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index fa71429..05ae8ca 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4730,6 +4730,27 @@ # @henkan: since 2.9 # @yen: since 2.9 # +# @sleep: since 2.10 +# @wake: since 2.10 +# @audionext: since 2.10 +# @audioprev: since 2.10 +# @audiostop: since 2.10 +# @audioplay: since 2.10 +# @audiomute: since 2.10 +# @volumeup: since 2.10 +# @volumedown: since 2.10 +# @mediaselect: since 2.10 +# @mail: since 2.10 +# @calculator: since 2.10 +# @computer: since 2.10 +# @ac_search: since 2.10 +# @ac_home: since 2.10 +# @ac_back: since 2.10 +# @ac_forward: since 2.10 +# @ac_stop: since 2.10 +# @ac_refresh: since 2.10 +# @ac_bookmarks: since 2.10 +# # Since: 1.3.0 # ## @@ -4751,7 +4772,12 @@ 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut', 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause', 'ro', 'hiragana', 'henkan', 'yen', - 'kp_comma', 'kp_equals', 'power' ] } + 'kp_comma', 'kp_equals', 'power', 'sleep', 'wake', + 'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute', + 'volumeup', 'volumedown', 'mediaselect', + 'mail', 'calculator', 'computer', + 'ac_search', 'ac_home', 'ac_back', 'ac_forward', 'ac_stop', + 'ac_refresh', 'ac_bookmarks' ] } ## # @KeyValue: diff --git a/ui/input-keymap.c b/ui/input-keymap.c index ffc581a..861c478 100644 --- a/ui/input-keymap.c +++ b/ui/input-keymap.c @@ -116,6 +116,28 @@ static int linux_to_qcode[KEY_CNT] = { [KEY_LEFTMETA] = Q_KEY_CODE_META_L, [KEY_RIGHTMETA] = Q_KEY_CODE_META_R, [KEY_MENU] = Q_KEY_CODE_MENU, + + [KEY_SLEEP] = Q_KEY_CODE_SLEEP, + [KEY_WAKEUP] = Q_KEY_CODE_WAKE, + [KEY_CALC] = Q_KEY_CODE_CALCULATOR, + [KEY_MAIL] = Q_KEY_CODE_MAIL, + [KEY_COMPUTER] = Q_KEY_CODE_COMPUTER, + + [KEY_STOP] = Q_KEY_CODE_AC_STOP, + [KEY_BOOKMARKS] = Q_KEY_CODE_AC_BOOKMARKS, + [KEY_BACK] = Q_KEY_CODE_AC_BACK, + [KEY_FORWARD] = Q_KEY_CODE_AC_FORWARD, + [KEY_HOMEPAGE] = Q_KEY_CODE_AC_HOME, + [KEY_REFRESH] = Q_KEY_CODE_AC_REFRESH, + [KEY_FIND] = Q_KEY_CODE_AC_SEARCH, + + [KEY_NEXTSONG] = Q_KEY_CODE_AUDIONEXT, + [KEY_PREVIOUSSONG] = Q_KEY_CODE_AUDIOPREV, + [KEY_STOPCD] = Q_KEY_CODE_AUDIOSTOP, + [KEY_PLAYCD] = Q_KEY_CODE_AUDIOPLAY, + [KEY_MUTE] = Q_KEY_CODE_AUDIOMUTE, + [KEY_VOLUMEDOWN] = Q_KEY_CODE_VOLUMEDOWN, + [KEY_VOLUMEUP] = Q_KEY_CODE_VOLUMEUP, }; static const int qcode_to_number[] = { @@ -253,6 +275,28 @@ static const int qcode_to_number[] = { [Q_KEY_CODE_YEN] = 0x7d, [Q_KEY_CODE_KP_COMMA] = 0x7e, + [Q_KEY_CODE_SLEEP] = 0xdf, + [Q_KEY_CODE_WAKE] = 0xe3, + [Q_KEY_CODE_CALCULATOR] = 0xa1, + [Q_KEY_CODE_MAIL] = 0xec, + [Q_KEY_CODE_COMPUTER] = 0xeb, + + [Q_KEY_CODE_AC_STOP] = 0xe8, + [Q_KEY_CODE_AC_BOOKMARKS] = 0xe6, + [Q_KEY_CODE_AC_BACK] = 0xea, + [Q_KEY_CODE_AC_FORWARD] = 0xe9, + [Q_KEY_CODE_AC_HOME] = 0xb2, + [Q_KEY_CODE_AC_REFRESH] = 0xe7, + [Q_KEY_CODE_AC_SEARCH] = 0xe5, + + [Q_KEY_CODE_AUDIONEXT] = 0x99, + [Q_KEY_CODE_AUDIOPREV] = 0x90, + [Q_KEY_CODE_AUDIOSTOP] = 0xa4, + [Q_KEY_CODE_AUDIOPLAY] = 0xa2, + [Q_KEY_CODE_AUDIOMUTE] = 0xa0, + [Q_KEY_CODE_VOLUMEDOWN] = 0xae, + [Q_KEY_CODE_VOLUMEUP] = 0xb0, + [Q_KEY_CODE__MAX] = 0, }; -- 1.8.3.1