add support for an "LED Toggle" key

pull/18/head
Jesse Vincent 10 years ago
parent cd59ea5863
commit 6fdcb2af21

@ -405,6 +405,14 @@ void handle_synthetic_key_press(byte switchState, Key mappedKey) {
Keyboard.consumerControl(mappedKey.rawKey); Keyboard.consumerControl(mappedKey.rawKey);
} }
} }
else if (mappedKey.flags & IS_INTERNAL) {
if (key_toggled_on (switchState)) {
if (mappedKey.rawKey == LED_TOGGLE) {
next_led_mode();
}
}
}
else if (mappedKey.flags & IS_SYSCTL) { else if (mappedKey.flags & IS_SYSCTL) {
if (key_toggled_on (switchState)) { if (key_toggled_on (switchState)) {
Keyboard.systemControl(mappedKey.rawKey); Keyboard.systemControl(mappedKey.rawKey);

@ -19,6 +19,12 @@ typedef struct {
#define IS_MACRO B00000001 #define IS_MACRO B00000001
#define IS_SYSCTL B00000010 #define IS_SYSCTL B00000010
#define IS_CONSUMER B00000100 #define IS_CONSUMER B00000100
#define IS_INTERNAL B00001000
// IS_INTERNAL key table:
#define LED_TOGGLE 1
#define MOUSE_UP B0000001 #define MOUSE_UP B0000001
@ -427,3 +433,7 @@ typedef struct {
#define Key_LEDEffectNext (Key) { KEY_FLAGS | SYNTHETIC_KEY | IS_INTERNAL, LED_TOGGLE }

Loading…
Cancel
Save