Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add F13 to F24 keys to USBKeyboard #636

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions libraries/USBHID/src/USBKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct {

#ifdef US_KEYBOARD
/* US keyboard (as HID standard) */
#define KEYMAP_SIZE (152)
#define KEYMAP_SIZE (164)
const KEYMAP keymap[KEYMAP_SIZE] = {
{0, 0}, /* NUL */
{0, 0}, /* SOH */
Expand Down Expand Up @@ -175,6 +175,18 @@ const KEYMAP keymap[KEYMAP_SIZE] = {
{0x43, 0}, /* F10 */
{0x44, 0}, /* F11 */
{0x45, 0}, /* F12 */
{0x68, 0}, /* F13 */
{0x69, 0}, /* F14 */
{0x6a, 0}, /* F15 */
{0x6b, 0}, /* F16 */
{0x6c, 0}, /* F17 */
{0x6d, 0}, /* F18 */
{0x6e, 0}, /* F19 */
{0x6f, 0}, /* F20 */
{0x70, 0}, /* F21 */
{0x71, 0}, /* F22 */
{0x72, 0}, /* F23 */
{0x73, 0}, /* F24 */

{0x46, 0}, /* PRINT_SCREEN */
{0x47, 0}, /* SCROLL_LOCK */
Expand All @@ -193,7 +205,7 @@ const KEYMAP keymap[KEYMAP_SIZE] = {

#else
/* UK keyboard */
#define KEYMAP_SIZE (152)
#define KEYMAP_SIZE (164)
const KEYMAP keymap[KEYMAP_SIZE] = {
{0, 0}, /* NUL */
{0, 0}, /* SOH */
Expand Down Expand Up @@ -336,6 +348,18 @@ const KEYMAP keymap[KEYMAP_SIZE] = {
{0x43, 0}, /* F10 */
{0x44, 0}, /* F11 */
{0x45, 0}, /* F12 */
{0x68, 0}, /* F13 */
{0x69, 0}, /* F14 */
{0x6a, 0}, /* F15 */
{0x6b, 0}, /* F16 */
{0x6c, 0}, /* F17 */
{0x6d, 0}, /* F18 */
{0x6e, 0}, /* F19 */
{0x6f, 0}, /* F20 */
{0x70, 0}, /* F21 */
{0x71, 0}, /* F22 */
{0x72, 0}, /* F23 */
{0x73, 0}, /* F24 */

{0x46, 0}, /* PRINT_SCREEN */
{0x47, 0}, /* SCROLL_LOCK */
Expand Down
12 changes: 12 additions & 0 deletions libraries/USBHID/src/USBKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ enum FUNCTION_KEY {
KEY_F10, /* F10 key */
KEY_F11, /* F11 key */
KEY_F12, /* F12 key */
KEY_F13, /* F13 key */
KEY_F14, /* F14 key */
KEY_F15, /* F15 key */
KEY_F16, /* F16 key */
KEY_F17, /* F17 key */
KEY_F18, /* F18 key */
KEY_F19, /* F19 key */
KEY_F20, /* F20 key */
KEY_F21, /* F21 key */
KEY_F22, /* F22 key */
KEY_F23, /* F23 key */
KEY_F24, /* F24 key */

KEY_PRINT_SCREEN, /* Print Screen key */
KEY_SCROLL_LOCK, /* Scroll lock */
Expand Down