Arduino Micro shortcut generator

Arduino Micro shortcut generator

thingiverse

Inspired by http://petapixel.com/2016/06/13/brushknob-puts-knob-button-fingertips-photoshop/ He uses an Atmel ATtiny85 with an encoder, so it can be a pain in the **s, my version features an Arduino Micro (important, since only single processor arduinos can simulate HID devices) and a PS2 joystick. His idea only allows to change brush size by turning the knob and switching brush and eraser tool alternatively, my version allows to change brush size (y axis), rotate between the six more used tools (by me, but can be customized on Arduino IDE), and pressing the joystick sends the most useful shortcut: ctrl + 0 Or you can use it as Arduino micro holder ^_^ --------------- UPDATE -------------- After few days using the device, found it more useful than I thought and I eventually need another one, to avoid building a second one, added a switch, so can change its behaviour, also added room for the switch itself and a cap. Even if you don't need the extra room for the switch, I recommend you to print the v2, it has a better grip, specially if your hands are big like mine ^_^ Arduino Code include "Keyboard.h" define KEY_LEFT_GUI 0x83 int herramientas[6] = {'z', 'v', 'm', 'c', 'j', 'e'}; int ind_herr = 0; int retardo = 400; int buttonPin = 14; void setup() { pinMode(buttonPin, INPUT); digitalWrite(buttonPin, HIGH); } void loop() { int leex = analogRead(0); int leey = analogRead(2); if (digitalRead(buttonPin) == 0) { Keyboard.press(KEY_LEFT_GUI); Keyboard.write('0'); Keyboard.release(KEY_LEFT_GUI); delay(retardo); } //---------------------------------------------------------------- if (leex < 300) { herramienta_dcha(); } if (leex > 600) { herramienta_izda(); } //---------------------------------------------------------------- if (leey < 300) { Keyboard.write('.'); delay(retardo / 4); } if (leey > 600) { Keyboard.write(','); delay(retardo / 4); } } void herramienta_izda() { ind_herr--; if (ind_herr < 0) { ind_herr = 5; } Keyboard.write(herramientas[ind_herr]); delay(retardo); } void herramienta_dcha() { ind_herr++; if (ind_herr > 5) { ind_herr = 0; } Keyboard.write(herramientas[ind_herr]); delay(retardo); } (Don't forget to add the # in front of the define and the include) Special keys definitions define KEY_LEFT_CTRL 0x80 define KEY_LEFT_SHIFT0x81 define KEY_LEFT_ALT 0x82 define KEY_LEFT_GUI 0x83 define KEY_RIGHT_CTRL0x84 define KEY_RIGHT_SHIFT 0x85 define KEY_RIGHT_ALT 0x86 define KEY_RIGHT_GUI 0x87 define KEY_UP_ARROW 0xDA define KEY_DOWN_ARROW 0xD9 define KEY_LEFT_ARROW 0xD8 define KEY_RIGHT_ARROW 0xD7 define KEY_BACKSPACE 0xB2 define KEY_TAB 0xB3 define KEY_RETURN 0xB0 define KEY_ESC 0xB1 define KEY_INSERT 0xD1 define KEY_DELETE 0xD4 define KEY_PAGE_UP 0xD3 define KEY_PAGE_DOWN 0xD6 define KEY_HOME 0xD2 define KEY_END 0xD5 define KEY_CAPS_LOCK 0xC1 define KEY_F1 0xC2 define KEY_F2 0xC3 define KEY_F3 0xC4 define KEY_F4 0xC5 define KEY_F5 0xC6 define KEY_F6 0xC7 define KEY_F7 0xC8 define KEY_F8 0xC9 define KEY_F9 0xCA define KEY_F10 0xCB define KEY_F11 0xCC define KEY_F12 0xCD Notes We create the "herramientas" array with the tools we want to use, those will be sent using the x axis, ind_herr is a pointer, when we reach the end of the array, will send us to the other side, so rotation will be continous. To send special keys in shortcuts you need to define the special key, in this case KEY_LEFT_GUI as 0x83 (left cmd key on a mac), will add a defines table later. As you can see, it's very straightforward: press special key, send char, release special key.

Download Model from thingiverse

With this file you will be able to print Arduino Micro shortcut generator with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Arduino Micro shortcut generator.