press/releaseKeyRaw -> press/releaseRawKey

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

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

Loading…
Cancel
Save