Skip to content

Commit 7690712

Browse files
committed
fix(ble): Add missing modifier keys for HID Keyboard
1 parent 3239ee2 commit 7690712

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

libraries/BLE/src/HIDKeyboardTypes.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,28 @@
2121
#ifndef KEYBOARD_DEFS_H
2222
#define KEYBOARD_DEFS_H
2323

24+
#include "esp_bit_defs.h"
25+
2426
#define REPORT_ID_KEYBOARD 1
2527
#define REPORT_ID_VOLUME 3
2628

2729
/* Modifiers */
2830
enum MODIFIER_KEY {
29-
KEY_CTRL = 1,
30-
KEY_SHIFT = 2,
31-
KEY_ALT = 4,
31+
/* Aliases for the left modifiers */
32+
KEY_CTRL = BIT(0),
33+
KEY_SHIFT = BIT(1),
34+
KEY_ALT = BIT(2),
35+
KEY_GUI = BIT(3), /*!< GUI key (Command on macOS, Windows key on Windows) */
36+
/* Left modifiers */
37+
KEY_LEFT_CTRL = BIT(0),
38+
KEY_LEFT_SHIFT = BIT(1),
39+
KEY_LEFT_ALT = BIT(2),
40+
KEY_LEFT_GUI = BIT(3),
41+
/* Right modifiers */
42+
KEY_RIGHT_CTRL = BIT(4),
43+
KEY_RIGHT_SHIFT = BIT(5),
44+
KEY_RIGHT_ALT = BIT(6),
45+
KEY_RIGHT_GUI = BIT(7),
3246
};
3347

3448
enum MEDIA_KEY {

0 commit comments

Comments
 (0)