UPDATE: This post is now defunct because I created an updated version of the DigiKeyboard package for UK keyboards available here: https://github.com/p0ep0e/DigiKeyboardUK
So I recently delved in to the world of DigiSpark Attiny85 boards with a view to making a low-cost (disposible) Rubby Ducky for cyber security and pen testing work.
Unfortunately, while these little boards are “ok”, the DigiKeyboard.h library is built to map US keyboard scan codes to ASCII characters. For UK keyboards this is OK for the most part but some special characters are an absolute bastard to work out.
NOTE: I’d say the DigiSpark boards are great but they have clear hit-and-miss issues with USB 3.0 controllers that I suspect is going to render them useful over the next few years as these USB 3.0 becomes the standard.
Useful links
Hut1_12v2 USB HID Usage Tables
On page 53 is a table which contains the scan codes Usage ID (DEC) column for each of the keys on a US keyboard.
Download the Hut1_12v2 PDF here
How to type tricky characters on a DigiSpark in the UK
Using the @ symbol as an example:
Locate the @ symbol on your own keybboard
Find the corresponding key on a US keyboard (this image may help)
In our example, the @ symbol is actually a quotation mark ” on the US keyboard
Using the Hut1_12v2.pdf (useful links and documents above – page 53 of the PDF) find the character in the table and grab the Usage ID, in this example it’s number 52
Send the usage ID using thesendKeyStroke command, adding MOD_SHIFT_LEFT if its required for that character on the US keyboard, for example:
DigiKeyboard.sendKeyStroke(52,MOD_SHIFT_LEFT);
When I get more time I’ll pull together
The pipe symbol | was particularly difficult to sort but can be typed using:
DigiKeyboard.sendKeyStroke(100,MOD_SHIFT_LEFT);
The @ symbol can be typed using:
DigiKeyboard.sendKeyStroke(52,MOD_SHIFT_LEFT);