Arduino USB Keyboard free programmable build yourself.A resistive touchscreen panel with paper background acts as a macro keypad / touchpad.
A Leonardo ATmega32U4 simulates a keyboard that enters keyboard shortcuts, macros, text blocks, passwords.
- Very simply only 3 components
- Very cheap the components cost a total of 10 €
- Paper underlay Can you design yourself. Simply insert your own icons and texts in Excel and print them out
- Number and size of the keys are flexible
- Keyboard Shortcuts and Shortcuts (Hotkey)
- Text modules
- Passwords
- Macros with programmable time delays
Glue any resistive touchscreen panel to a hard surface on the edge on 2 sides with double-sided adhesive tape. Create a table in Excel with dimensions of the touch area. Find suitable icons on the Internet and paste them into the cells of the table. Cut out the printed table and insert it between the base and the touch panel from the side. On the back of the USB macro keyboard, the Pro Micro module is glued to ATmega32U4 (similar to the Arduino Leonardo board) and a piezo transducer. This is the hardware ready. This is a very light DIY craft project that even a beginner in electronics can build himself. The wiring diagram contains only 3 components. It is also very cheap piece of work. Resistive Touch Screen Digitizer Glass 155mm 88mm costs for example at 5.36 € Pro Micro module costs eg with Aliexpress 3.30 € Piezo 0, 70 € The total cost of the self-made USB shortcut keyboards to 9.36 €
Circut diagramI have inserted a piezo buzzer in the circuit in order to realize an acoustic message of an actuation of the button.
After pressing on a touch field, a quiet crackling noise is generated.
At the piezo 5V and 0V are changed with each actuation.
Calibration of the resistive touchscreen panelAt first use, the Arduino USB Keyboard should be calibrated once.
Start Arduino Terminal and send character "k".
You will be asked to print once at the top left and bottom right.
Best Make the corner of the outside edge of the table on the paper underlay.
The calibration values are stored permanently in the EEPROM.
When reloading the sketch, they are also preserved.
By sending the "r" characters, a mode is activated in which the raw data is output via the serial interface for debugging purposes.
One time X / Y values of the AD converter and the converted values of columns and rows No of the cell in the table.
The programming of the USB macro keypadThe keyboard shortcuts, shortcuts, keyboard shortcuts, text blocks, and keyboard shortcuts are stored in a table in Arduino Leonardo Controller program memory.
At the beginning of the sketch, a two-dimensional string array is created.
The positions of the strings in the array correspond to the cells on the touchscreen panel
#define rows 3
#define columns 4
const String data [rows] [columns] =
{
{"1", "2", "3", "A"},
{"4", "5", "6", "B"},
{"7", "8", "9", "C"},
};
You can decide for yourself how many keys you want to place on the Touch Keypad.
Prerequisite is the touch area should still be lightly hit by the finger.
I think the minimum area is 10x10mm.
Thus, 15 * 8 = 120 keys (buttons) can be placed on the 155mm 88mm touch screen panel.
macros and keyboard shortcutsThe texts in the data string are transmitted to the computer directly after the touch button is pressed, as if they were typed.
To save keyboard shortcuts and macros I have provided 4 script commands.
Each script command begins with "§" characters and ends with "" spacebar characters.
§p - Press "§p0x80 " Strg drücken
§r - Release "§r0x80 " Strg loslassen
§a - Release All "§a " Alle Tasten Loslassen
§w - Write "§w0xB0 " Enter klicken
§t - Timer "§t3000 " 3 Sekunden abwarten
The texts in the data string are transmitted to the computer directly after the touch button is pressed, as if they were typed. To save keyboard shortcuts and macros I have provided 4 script commands. Each script command begins with "§" characters and ends with "" spacebar characters.
§P - Press "§p0x80" Press Ctrl
§R Release "§r0x80" Release Ctrl
§A - Release All "§a" Release all buttons
§W - Write "§w0xB0" Enter click
§T - Wait "§t3000" for 3 seconds
This is how the macro looks like for the PC "§P0x87 r§r0x87 §t100 shutdown -s -t 0 -f \ n" press 0x87 write string "r" Release 0x87 wait 100mS write string "shutdown -s -t 0 -f" new line (same as Enter)
Press Windows key (Code 0x87 RIGHT_GU see KeyboardDE.h), click r key, release Windows key. This is the shortcut key for Run dialog. Then 0.1s is waited for the dialog window to open. Then "shutdown -s -t 0 -f" is entered. Windows Shutdown command and then pressed with "\ n" Enter. Arduino IDE supports the following escape code: \ n 10 LF (Line Feed) - Start new line (new line) Enter key 13 CR (Carriage Return) - Go to the beginning of a line (return) \ t 9 Tab - Advance cursor to next tab-stop (tab) \ "34 Double Quote \ '39 single quote \\ 92 Backslash - so we can actually type that one as well To enter Click alternatively to "\ n" the script command "§w0xb0" can be used. w-Write 0xb0 code for KEY_BACKSPACE (see KeyboardDE.h)
SketchDownload Sketch für ATmega32U4
Create a custom layout for the TouchPad with ExcelNach oben
Comments
Please log in or sign up to comment.