press/releaseKeyRaw -> press/releaseRawKey

pull/144/merge
Jesse Vincent 7 years ago
parent 4ee9ca4e63
commit c9734385c5
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -64,32 +64,32 @@ void initializeKeyboard() {
Keyboard.begin(); Keyboard.begin();
} }
void pressKeyRaw(Key mappedKey) { void pressRawKey(Key mappedKey) {
Keyboard.press(mappedKey.keyCode); Keyboard.press(mappedKey.keyCode);
} }
void pressKey(Key mappedKey) { void pressKey(Key mappedKey) {
if (mappedKey.flags & SHIFT_HELD) { if (mappedKey.flags & SHIFT_HELD) {
pressKeyRaw(Key_LeftShift); pressRawKey(Key_LeftShift);
} }
if (mappedKey.flags & CTRL_HELD) { if (mappedKey.flags & CTRL_HELD) {
pressKeyRaw(Key_LeftControl); pressRawKey(Key_LeftControl);
} }
if (mappedKey.flags & LALT_HELD) { if (mappedKey.flags & LALT_HELD) {
pressKeyRaw(Key_LeftAlt); pressRawKey(Key_LeftAlt);
} }
if (mappedKey.flags & RALT_HELD) { if (mappedKey.flags & RALT_HELD) {
pressKeyRaw(Key_RightAlt); pressRawKey(Key_RightAlt);
} }
if (mappedKey.flags & GUI_HELD) { if (mappedKey.flags & GUI_HELD) {
pressKeyRaw(Key_LeftGui); pressRawKey(Key_LeftGui);
} }
pressKeyRaw(mappedKey); pressRawKey(mappedKey);
} }
void releaseKeyRaw(Key mappedKey) { void releaseRawKey(Key mappedKey) {
Keyboard.release(mappedKey.keyCode); Keyboard.release(mappedKey.keyCode);
} }
@ -100,21 +100,21 @@ void releaseAllKeys() {
void releaseKey(Key mappedKey) { void releaseKey(Key mappedKey) {
if (mappedKey.flags & SHIFT_HELD) { if (mappedKey.flags & SHIFT_HELD) {
releaseKeyRaw(Key_LeftShift); releaseRawKey(Key_LeftShift);
} }
if (mappedKey.flags & CTRL_HELD) { if (mappedKey.flags & CTRL_HELD) {
releaseKeyRaw(Key_LeftControl); releaseRawKey(Key_LeftControl);
} }
if (mappedKey.flags & LALT_HELD) { if (mappedKey.flags & LALT_HELD) {
releaseKeyRaw(Key_LeftAlt); releaseRawKey(Key_LeftAlt);
} }
if (mappedKey.flags & RALT_HELD) { if (mappedKey.flags & RALT_HELD) {
releaseKeyRaw(Key_RightAlt); releaseRawKey(Key_RightAlt);
} }
if (mappedKey.flags & GUI_HELD) { if (mappedKey.flags & GUI_HELD) {
releaseKeyRaw(Key_LeftGui); releaseRawKey(Key_LeftGui);
} }
releaseKeyRaw(mappedKey); releaseRawKey(mappedKey);
} }
boolean isModifierKeyActive(Key mappedKey) { boolean isModifierKeyActive(Key mappedKey) {
@ -151,9 +151,7 @@ void releaseSystemControl(Key mappedKey) {
} }
/** Mouse events // Mouse events
* See above for commentary on connectionMask. */
void initializeMouse() { void initializeMouse() {
Mouse.begin(); Mouse.begin();
@ -175,8 +173,7 @@ void releaseMouseButtons(uint8_t buttons) {
Mouse.release(buttons); Mouse.release(buttons);
} }
/** Absolute mouse (grapahics tablet) events /** Absolute mouse (grapahics tablet) events */
* See above for commentary on connectionMask. */
void initializeAbsoluteMouse() { void initializeAbsoluteMouse() {
AbsoluteMouse.begin(); AbsoluteMouse.begin();

@ -51,8 +51,8 @@ void initializeKeyboard();
void pressKey(Key mappedKey); void pressKey(Key mappedKey);
void releaseKey(Key mappedKey); void releaseKey(Key mappedKey);
void releaseAllKeys(); void releaseAllKeys();
void pressKeyRaw(Key mappedKey); void pressRawKey(Key mappedKey);
void releaseKeyRaw(Key mappedKey); void releaseRawKey(Key mappedKey);
/** Flushes any pending regular key switch events and sends them out */ /** Flushes any pending regular key switch events and sends them out */
void sendKeyboardReport(); void sendKeyboardReport();

Loading…
Cancel
Save