|
| 1 | +/* |
| 2 | + KeyboardModifiers |
| 3 | + |
| 4 | + Select one word each second while extending the current text selection. |
| 5 | + |
| 6 | + The purpose of this demo is to demonstrate how to use the modifier keys. |
| 7 | + Some keys such as the arrow and function keys are mapped in a list so you |
| 8 | + don't have to know the key codes. You can find them in the file USBKeyboard.h. |
| 9 | + |
| 10 | + For these keys you can use the function key_code(). |
| 11 | + For other keys such as character keys you need to look up the key codes |
| 12 | + and use the key_code_raw() function. |
| 13 | + |
| 14 | + Author: Sebastian Romero @sebromero |
| 15 | + |
| 16 | + This example code is in the public domain. |
| 17 | +*/ |
| 18 | + |
| 19 | +#include "PluggableUSBHID.h" |
| 20 | +#include "USBKeyboard.h" |
| 21 | + |
| 22 | +USBKeyboard Keyboard; |
| 23 | + |
| 24 | +void setup() {} |
| 25 | + |
| 26 | +void loop() { |
| 27 | + delay(1000); |
| 28 | + Keyboard.key_code(RIGHT_ARROW, KEY_SHIFT | KEY_ALT); |
| 29 | + |
| 30 | + delay(1000); |
| 31 | + // Alternatively you can use the raw key code for RIGHT_ARROW 0x4f |
| 32 | + Keyboard.key_code_raw(0x4f, KEY_SHIFT | KEY_ALT); |
| 33 | +} |
0 commit comments