From 8ebfb9b09d6c5f35c5a65460a33e6e48e5179c42 Mon Sep 17 00:00:00 2001 From: eson Date: Wed, 12 Feb 2020 12:14:43 +0900 Subject: [PATCH] Add defines for function key values of keyboard Add key values of keyboard for TV volume and chennel and arrow control. Change-Id: I0baa9b0255d69a236dafae59bbeb743f9f2963a1 --- test/hid_keyboard.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/hid_keyboard.c b/test/hid_keyboard.c index 9ef7277..e4e6b11 100644 --- a/test/hid_keyboard.c +++ b/test/hid_keyboard.c @@ -29,6 +29,21 @@ #define INIT_BOND 0 +#define KEYBOARD_RETURN 0x28 // Enter +#define KEYBOARD_ESCAPE 0x29 // Back +#define KEYBOARD_F5 0x3e // Smart Hub +#define KEYBOARD_F6 0x3f // Source +#define KEYBOARD_F7 0x40 // Channel List +#define KEYBOARD_F8 0x41 // Volume Mute +#define KEYBOARD_F9 0x42 // Volume Down +#define KEYBOARD_F10 0x43 // Volume Up +#define KEYBOARD_F11 0x44 // Channel Down +#define KEYBOARD_F12 0x45 // Channel Up +#define KEYBOARD_RIGHT 0x4f // Arrow Right +#define KEYBOARD_LEFT 0x50 // Arrow Left +#define KEYBOARD_DOWN 0x51 // Arrow Down +#define KEYBOARD_UP 0x52 // Arrow Up + /** * Variables **/ @@ -582,7 +597,7 @@ static int __bt_test_input_callback(void *data) int test_id = (int)data; #endif bt_hid_key_data_s send_data; - char pressedkey[8] = { 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + char pressedkey[8] = { KEYBOARD_F10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; char pressedkey1[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #if INIT_BOND @@ -620,7 +635,7 @@ static int __bt_test_input_callback(void *data) break; #endif case BT_HID_DEVICE_TEST_VOLUME_UP: - pressedkey[0] = 0x43; /* Vol up */ + pressedkey[0] = KEYBOARD_F10; /* Vol up */ memcpy(send_data.key, pressedkey, 8); send_data.modifier = 0; @@ -633,7 +648,7 @@ static int __bt_test_input_callback(void *data) break; case BT_HID_DEVICE_TEST_VOLUME_DOWN: - pressedkey[0] = 0x42; /* Vol down */ + pressedkey[0] = KEYBOARD_F9; /* Vol down */ memcpy(send_data.key, pressedkey, 8); send_data.modifier = 0; @@ -646,7 +661,7 @@ static int __bt_test_input_callback(void *data) break; case BT_HID_DEVICE_TEST_CHANNEL_UP: - pressedkey[0] = 0x45; /* CH up */ + pressedkey[0] = KEYBOARD_F12; /* CH up */ HID_PRT("key_code %d", key_code); @@ -661,7 +676,7 @@ static int __bt_test_input_callback(void *data) break; case BT_HID_DEVICE_TEST_CHANNEL_DOWN: - pressedkey[0] = 0x44; /* CH down */ + pressedkey[0] = KEYBOARD_F11; /* CH down */ memcpy(send_data.key, pressedkey, 8); send_data.modifier = 0; -- 2.7.4