Add a facde for KeyboardioHID's *.begin()

pull/144/merge
Jesse Vincent 8 years ago
parent 8b187366c7
commit 02695b8cea
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -59,6 +59,11 @@ void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState) {
handleKeyswitchEventDefault(mappedKey, row, col, keyState);
}
void initializeKeyboard() {
Keyboard.begin();
}
void pressKeyRaw(Key mappedKey) {
Keyboard.press(mappedKey.keyCode);
@ -114,11 +119,14 @@ void releaseKey(Key mappedKey) {
void sendKeyboardReport() {
Keyboard.sendReport();
}
void initializeConsumerControl() {
ConsumerControl.begin();
}
void pressConsumer(Key mappedKey) {
ConsumerControl.press(mappedKey.keyCode);
}
@ -127,6 +135,11 @@ void releaseConsumer(Key mappedKey) {
ConsumerControl.release(mappedKey.keyCode);
}
void initializeSystemControl() {
SystemControl.begin();
}
void pressSystem(Key mappedKey) {
SystemControl.press(mappedKey.keyCode);
}
@ -140,6 +153,10 @@ void releaseSystem(Key mappedKey) {
* See above for commentary on connectionMask. */
void initializeMouse() {
Mouse.begin();
}
void moveMouse(signed char x, signed char y, signed char wheel) {
Mouse.move(x, y, wheel);
}
@ -159,6 +176,10 @@ void releaseMouseButtons(uint8_t buttons) {
/** Absolute mouse (grapahics tablet) events
* See above for commentary on connectionMask. */
void initializeAbsoluteMouse() {
AbsoluteMouse.begin();
}
void moveAbsoluteMouse(signed char x, signed char y, signed char wheel) {
AbsoluteMouse.move(x, y, wheel);
}

@ -43,26 +43,38 @@ extern const Key keymaps[][ROWS][COLS];
*/
void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState);
/** Flushes any pending regular key switch events and sends them out */
void sendKeyboardReport();
// A facade on top of our HID implementation
void initializeKeyboard();
void pressKey(Key mappedKey);
void releaseKey(Key mappedKey);
void releaseAllKeys();
void pressKeyRaw(Key mappedKey);
void releaseKeyRaw(Key mappedKey);
/** Flushes any pending regular key switch events and sends them out */
void sendKeyboardReport();
void initializeConsumerControl();
void pressConsumer(Key mappedKey);
void releaseConsumer(Key mappedKey);
void initializeSystemControl();
void pressSystem(Key mappedKey);
void releaseSystem(Key mappedKey);
void initializeMouse();
void moveMouse(signed char x, signed char y, signed char wheel);
void clickMouseButtons(uint8_t buttons);
void pressMouseButtons(uint8_t buttons);
void releaseMouseButtons(uint8_t buttons);
void initializeAbsoluteMouse();
void moveAbsoluteMouse(signed char x, signed char y, signed char wheel);
void moveAbsoluteMouseTo(uint16_t x, uint16_t y, signed char wheel);
void clickAbsoluteMouseButtons(uint8_t buttons);

Loading…
Cancel
Save