Guest User

Keyboard demo

a guest
Jun 15th, 2017
2,613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <Keyboard.h>
  2.  
  3. void setup() {
  4.   // put your setup code here, to run once:
  5.   Keyboard.begin();
  6.   delay(1000);
  7.  
  8.   Keyboard.press(KEY_LEFT_GUI);
  9.   Keyboard.press('r');
  10.   delay(10);
  11.   Keyboard.releaseAll();
  12.   delay(200);
  13.  
  14.   Keyboard.print("notepad");
  15.   Keyboard.press(KEY_RETURN);
  16.   delay(10);
  17.   Keyboard.releaseAll();
  18.   delay(500);
  19.   Keyboard.print("This message will self destruct in 5 seconds!");
  20.   delay(5000);
  21.  
  22.   Keyboard.press(KEY_LEFT_CTRL);
  23.   Keyboard.press('a');
  24.   delay(10);
  25.   Keyboard.releaseAll();
  26.  
  27.   Keyboard.press(KEY_DELETE);
  28.   delay(10);
  29.   Keyboard.releaseAll();
  30.  
  31.   Keyboard.press(KEY_LEFT_ALT);
  32.   Keyboard.press(KEY_F4);
  33.   delay(10);
  34.   Keyboard.releaseAll();
  35.  
  36.   Keyboard.end();
  37.  
  38. }
  39.  
  40. void loop() {
  41.   // put your main code here, to run repeatedly:
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment