Arduino Macro Keyboard



Keyboard

Now why didn’t we think of this? While building a dactyl manuform — a semi-ergonomic split keyboard — [dapperrogue] had the life-changing epiphany that keyboards can be any shape or size, as long as there is room for wiring and a microcontroller inside. [dapperrogue]’s first foray into the world of fictional ordnance came in the form of an F-bomb — a round macro keeb made in the classic round explosive shape and covered with function keys. Building on the explosive feedback from that, [dapperrogue] built this bomb of a pineapple keeb, the only anti-personnel factor being the clickiness of the key switches.

The idea of a reconfigurable macro keyboard is a concept that has been iterated on by many all the way from custom DIY keypads to the polarizing TouchBar on MacBooks. The continual rise of cheap.

Arduino keyboard emulator

Arduino Keyboard Emulator

This groovy grenade has 25 keys total, 24 of which are in a 4×6 grid around the body. The 25th key, the best one, is hiding under the lever and you bet it can only be actuated by pulling the pin first. We love the use of the lever because it makes us think of Morse code keyers, which might be what we would use that switch for.

Keyboard.press(KEYLEFTGUI); Keyboard.press('r'); Keyboard.release(KEYLEFTGUI); Keyboard.release('r'); delay(50); //give your system time to catch up with these android-speed keyboard presses Keyboard.println('chrome'); delay(500); Keyboard.println('break; case '9': //macro that opens Chrome & Rick Rolls you like a chump Keyboard.press(KEYLEFTGUI); Keyboard.press('r'); Keyboard.release(KEYLEFTGUI); Keyboard. A word of caution on using the Mouse and Keyboard libraries: if the Mouse or Keyboard library is constantly running, it will be difficult to program your board.Functions such as Mouse.move and Keyboard.print will move your cursor or send keystrokes to a connected computer and should only be called when you are ready to handle them. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: B (digital pin 8 to 13) C (analog input pins) D (digital pins 0 to 7) Each port is controlled by three registers, which are also defined variables in the arduino language. The DDR register, determines whether the. Macro keyboard with 8x cherry mx and a rotary encoder using Arduino Micro - mensikv/VMs-macro-keyboard.

Inside is an Arduino Pro Micro running QMK and some skillful wiring. The entirely 3D-printed enclosure is in two main pieces that are connected with M3 screws, plus the top. If you want to pack one of your own, the STLs and firmware are out on GitHub. Just don’t take it to the airport.

Arduino Uno Macro Keyboard

Be sure to check out the demos after the break — in the stock firmware, every key types out a different onomatopoeic boom-type sound. Are you more of a pacifist when it comes to macro pad design? That’s understandable. We have plenty of different builds to admire.

Feb 8th, 2018
Never
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
Keyboard
  1. //Version: 1.0.0
  2. //Last edited: 08-Feb-2018
  3. #include <Keyboard.h>
  4. /*By default the keyboard library isn't supporting F13 to F24, you have to make an edit in the Library and add the following Hex keys.
  5. Since barely any software uses F13 to F24 they're great for hotkeys.
  6. See this thread for more infos https://forum.arduino.cc/index.php?topic=324554.0 */
  7. #define KEY_F14 0xF1
  8. #define KEY_F16 0xF3
  9. #define KEY_F18 0xF5
  10. #define KEY_F20 0xF7
  11. #define KEY_F22 0xF9
  12. #define KEY_F24 0xFB
  13. void setup()
  14. //no setup needed
  15. /*The loop reads the analog inputs and compares the values with pre-evaluated values.
  16. The pro micro doesn't come with A4 or A5, so those are skipped.
  17. If a value is matched the pressHotkey function is called.*/
  18. {
  19. {
  20. continue;
  21. if(analogRead(i)>=980){//~1005
  22. while(analogRead(i)>=980){//This is an elegant way to debounce and prevent accidental multiple button presses
  23. delay(50);//it basically makes the action 'on button release'
  24. pressHotkey(i, 1);
  25. elseif(analogRead(i)>940&& analogRead(i)<970){//~956 - the average value reported by the serial monitor during testing
  26. delay(50);
  27. pressHotkey(i, 2);
  28. elseif(analogRead(i)>900&& analogRead(i)<930){//~912
  29. delay(50);
  30. pressHotkey(i, 3);
  31. elseif(analogRead(i)>850&& analogRead(i)<880){//~865
  32. delay(50);
  33. pressHotkey(i, 4);
  34. elseif(analogRead(i)>820&& analogRead(i)<851){//~842
  35. delay(50);
  36. pressHotkey(i, 5);
  37. }
  38. Keyboard.begin();
  39. switch(y){
  40. Keyboard.press(KEY_F14);//The keypresses could also be replaced with text macros
  41. delay(10);//A delay after a keypress is recommended so it gets registered correctly
  42. Keyboard.releaseAll();//Keyboard.press holds a key down forever so make sure to release it afterwards
  43. case2:
  44. delay(10);
  45. break;
  46. Keyboard.press(KEY_F16);
  47. Keyboard.releaseAll();
  48. case4:
  49. delay(10);
  50. break;
  51. Keyboard.press(KEY_F18);
  52. Keyboard.releaseAll();
  53. }
  54. elseif(x 1){
  55. case1:
  56. delay(10);
  57. break;
  58. Keyboard.press(KEY_F20);
  59. Keyboard.releaseAll();
  60. case3:
  61. delay(10);
  62. break;
  63. Keyboard.press(KEY_F22);
  64. Keyboard.releaseAll();
  65. case5:
  66. delay(10);
  67. break;
  68. }
  69. switch(y){
  70. Keyboard.press(KEY_LEFT_SHIFT);
  71. Keyboard.press(KEY_F14);
  72. Keyboard.releaseAll();
  73. case2:
  74. delay(10);
  75. delay(10);
  76. break;
  77. Keyboard.press(KEY_LEFT_SHIFT);
  78. Keyboard.press(KEY_F16);
  79. Keyboard.releaseAll();
  80. case4:
  81. delay(10);
  82. delay(10);
  83. break;
  84. Keyboard.press(KEY_LEFT_SHIFT);
  85. Keyboard.press(KEY_F18);
  86. Keyboard.releaseAll();
  87. }
  88. elseif(x 3){
  89. case1:
  90. delay(10);
  91. delay(10);
  92. break;
  93. Keyboard.press(KEY_LEFT_SHIFT);
  94. Keyboard.press(KEY_F20);
  95. Keyboard.releaseAll();
  96. case3:
  97. delay(10);
  98. delay(10);
  99. break;
  100. Keyboard.press(KEY_LEFT_SHIFT);
  101. Keyboard.press(KEY_F22);
  102. Keyboard.releaseAll();
  103. case5:
  104. delay(10);
  105. delay(10);
  106. break;
  107. }
  108. switch(y){
  109. Keyboard.press(KEY_LEFT_ALT);
  110. Keyboard.press(KEY_F14);
  111. Keyboard.releaseAll();
  112. case2:
  113. delay(10);
  114. delay(10);
  115. break;
  116. Keyboard.press(KEY_LEFT_ALT);
  117. Keyboard.press(KEY_F16);
  118. Keyboard.releaseAll();
  119. case4:
  120. delay(10);
  121. delay(10);
  122. break;
  123. Keyboard.press(KEY_LEFT_ALT);
  124. Keyboard.press(KEY_F18);
  125. Keyboard.releaseAll();
  126. }
  127. elseif(x 7){
  128. case1:
  129. delay(10);
  130. delay(10);
  131. break;
  132. Keyboard.press(KEY_LEFT_ALT);
  133. Keyboard.press(KEY_F20);
  134. Keyboard.releaseAll();
  135. case3:
  136. delay(10);
  137. delay(10);
  138. break;
  139. Keyboard.press(KEY_LEFT_ALT);
  140. Keyboard.press(KEY_F22);
  141. Keyboard.releaseAll();
  142. case5:
  143. delay(10);
  144. delay(10);
  145. break;
  146. }
  147. Keyboard.end();//If you don't stop the keyboard emulation your COM port might remain busy which makes uploading a new sketch quite annoying.
  148. /*Copyright (c) 2018 Fabian Hunziker
  149. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
  150. (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
  151. publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do
  152. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  153. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  154. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  155. FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  156. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

Arduino Micro Keyboard Emulator

RAW Paste Data

Arduino Uno Macro Keyboard