Facebook
From Stained Wolf, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 308
  1. #include "Keyboard.h"
  2.  
  3. void typeKey(uint8_t key)
  4. {
  5.   Keyboard.press(key);
  6.   delay(50);
  7.   Keyboard.release(key);
  8. }
  9.  
  10. String sciezkazapisu = "%USERPROFILE%\hotdog.jpg";
  11.  
  12.  
  13.  
  14.  
  15. /* Init function */
  16. void setup()
  17. {
  18.   // Begining the Keyboard stream
  19.   Keyboard.begin();
  20.  
  21.   // Wait 500ms
  22.   delay(500);
  23.  
  24.   delay(3000);
  25.  
  26.   Keyboard.press(KEY_LEFT_GUI);
  27.   Keyboard.press('r');
  28.   Keyboard.releaseAll();
  29.  
  30.   delay(100);
  31.  
  32.   Keyboard.print("iexplore http://s3.amazonaws.com/rapgenius/hotdog.jpg");
  33.  
  34.   typeKey(KEY_RETURN);
  35.  
  36.   delay(2000);
  37.  
  38.   Keyboard.press(KEY_LEFT_CTRL);
  39.   Keyboard.press('s');
  40.   Keyboard.releaseAll();
  41.  
  42.   delay(100);
  43.  Keyboard.press(KEY_LEFT_ALT);
  44.  
  45.  
  46.   Keyboard.print("a");
  47.   Keyboard.releaseAll();
  48.  
  49.   delay(100);
  50.  
  51.   Keyboard.print(sciezkazapisu);
  52.  
  53.   delay(100);
  54.  
  55.   typeKey(KEY_RETURN);
  56.  
  57.   delay(100);
  58.     typeKey(KEY_RETURN);
  59.   delay(100);
  60.   Keyboard.press(KEY_LEFT_CTRL);
  61.   Keyboard.press('w');
  62.   Keyboard.releaseAll();
  63.   delay(100);
  64.   Keyboard.press(KEY_LEFT_CTRL);
  65.   Keyboard.press(KEY_ESC);
  66.   Keyboard.releaseAll();
  67.   delay(100);
  68.   Keyboard.print("paint");
  69.   delay(300);
  70.   typeKey(KEY_RETURN);
  71.  // Keyboard.press(KEY_RETURN);
  72.   delay(500);
  73.   Keyboard.press(KEY_LEFT_CTRL);
  74.   Keyboard.press('o');
  75.   Keyboard.releaseAll();
  76.   delay(500);
  77.   Keyboard.print("%USERPROFILE%\hotdog.jpg");
  78.   typeKey(KEY_RETURN);
  79.   delay(500);
  80.   Keyboard.press(KEY_LEFT_ALT);
  81.   Keyboard.press('p');
  82.   Keyboard.releaseAll();
  83.   delay(100);
  84.   Keyboard.print("s");
  85.   delay(500);
  86.     Keyboard.press(KEY_LEFT_ALT);
  87.  
  88.   Keyboard.print("p");
  89.   delay(300);
  90.   Keyboard.press('k');
  91.   Keyboard.releaseAll();
  92.   delay(500);
  93.   Keyboard.print("n");
  94.  
  95.   // Ending stream
  96.   Keyboard.end();
  97. }
  98.  
  99. /* Unused endless loop */
  100. void loop() {}