From b8dfa976ce796ede92dfefa6a39eb0a3b08acdce Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 28 Oct 2010 23:11:49 +0000 Subject: =?UTF-8?q?Added=20standard=20keyboard=20HID=20report=20scancode?= =?UTF-8?q?=20defines=20(thanks=20to=20L=C3=A1szl=C3=B3=20Monda).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Demos/Device/ClassDriver/Keyboard/Keyboard.c | 12 ++++++------ Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c | 10 +++++----- .../ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'Demos/Device/ClassDriver') diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index d17b238ef..34dee99d0 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -149,20 +149,20 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn uint8_t UsedKeyCodes = 0; if (JoyStatus_LCL & JOY_UP) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x04; // A + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_A; else if (JoyStatus_LCL & JOY_DOWN) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x05; // B + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_B; if (JoyStatus_LCL & JOY_LEFT) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x06; // C + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_C; else if (JoyStatus_LCL & JOY_RIGHT) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x07; // D + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_D; if (JoyStatus_LCL & JOY_PRESS) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x08; // E + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_E; if (ButtonStatus_LCL & BUTTONS_BUTTON1) - KeyboardReport->KeyCode[UsedKeyCodes++] = 0x09; // F + KeyboardReport->KeyCode[UsedKeyCodes++] = HID_KEYBOARD_SC_F; if (UsedKeyCodes) KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index 245bf0755..61f22d2ab 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -185,17 +185,17 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; if (JoyStatus_LCL & JOY_UP) - KeyboardReport->KeyCode[0] = 0x04; // A + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_A; else if (JoyStatus_LCL & JOY_DOWN) - KeyboardReport->KeyCode[0] = 0x05; // B + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_B; if (JoyStatus_LCL & JOY_LEFT) - KeyboardReport->KeyCode[0] = 0x06; // C + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_C; else if (JoyStatus_LCL & JOY_RIGHT) - KeyboardReport->KeyCode[0] = 0x07; // D + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_D; if (JoyStatus_LCL & JOY_PRESS) - KeyboardReport->KeyCode[0] = 0x08; // E + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_E; *ReportSize = sizeof(USB_KeyboardReport_Data_t); return false; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index a81b4d969..7c5411033 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -198,20 +198,20 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; if (JoyStatus_LCL & JOY_UP) - KeyboardReport->KeyCode[0] = 0x04; // A + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_A; else if (JoyStatus_LCL & JOY_DOWN) - KeyboardReport->KeyCode[0] = 0x05; // B + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_B; if (JoyStatus_LCL & JOY_LEFT) - KeyboardReport->KeyCode[0] = 0x06; // C + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_C; else if (JoyStatus_LCL & JOY_RIGHT) - KeyboardReport->KeyCode[0] = 0x07; // D + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_D; if (JoyStatus_LCL & JOY_PRESS) - KeyboardReport->KeyCode[0] = 0x08; // E + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_E; if (ButtonStatus_LCL & BUTTONS_BUTTON1) - KeyboardReport->KeyCode[0] = 0x09; // F + KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_F; *ReportSize = sizeof(USB_KeyboardReport_Data_t); return false; -- cgit v1.2.3