Browse Source

Add Keyboard.releaseAll() for Teensy3

teensy4-core
PaulStoffregen 11 years ago
parent
commit
d5d7af569e
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      teensy3/usb_keyboard.c
  2. +1
    -1
      teensy3/usb_keyboard.h

+ 2
- 0
teensy3/usb_keyboard.c View File



anybits = keyboard_modifier_keys; anybits = keyboard_modifier_keys;
keyboard_modifier_keys = 0; keyboard_modifier_keys = 0;
anybits |= keyboard_media_keys;
keyboard_media_keys = 0;
for (i=0; i < 6; i++) { for (i=0; i < 6; i++) {
anybits |= keyboard_keys[i]; anybits |= keyboard_keys[i];
keyboard_keys[i] = 0; keyboard_keys[i] = 0;

+ 1
- 1
teensy3/usb_keyboard.h View File

void send_now(void) { usb_keyboard_send(); } void send_now(void) { usb_keyboard_send(); }
void press(uint16_t n) { usb_keyboard_press_keycode(n); } void press(uint16_t n) { usb_keyboard_press_keycode(n); }
void release(uint16_t n) { usb_keyboard_release_keycode(n); } void release(uint16_t n) { usb_keyboard_release_keycode(n); }
void releaseAll(void);
void releaseAll(void) { usb_keyboard_release_all(); }
}; };


extern usb_keyboard_class Keyboard; extern usb_keyboard_class Keyboard;

Loading…
Cancel
Save