|
|
@ -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();
|
|
|
|