From f5aaedffd5d712a5334bdcfb7c9fbdb749a420b9 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 24 Jul 2017 23:42:25 -0700 Subject: [PATCH] add an "isModifierActive" to the hid facade --- src/key_events.cpp | 4 +++- src/key_events.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/key_events.cpp b/src/key_events.cpp index 30bb1193..25db39dc 100644 --- a/src/key_events.cpp +++ b/src/key_events.cpp @@ -117,7 +117,9 @@ void releaseKey(Key mappedKey) { releaseKeyRaw(mappedKey); } - +boolean isModifierKeyActive(Key mappedKey) { + return Keyboard.isModifierActive(mappedKey.keyCode); +} void sendKeyboardReport() { Keyboard.sendReport(); diff --git a/src/key_events.h b/src/key_events.h index a73a2bbb..d0333fdc 100644 --- a/src/key_events.h +++ b/src/key_events.h @@ -56,6 +56,8 @@ void releaseKeyRaw(Key mappedKey); /** Flushes any pending regular key switch events and sends them out */ void sendKeyboardReport(); +boolean isModifierKeyActive(Key mappedKey); + void initializeConsumerControl(); void pressConsumer(Key mappedKey);