Remap Inputs on ShaKey
The ShaKey comes programmed with inputs that emulates some keys on a keyboard as well as a mouse.
But did you know that you can also change its inputs? In this guide, you will learn how remap the ShaKey's inputs by editing an Arduino sketch.
Complete this guide to turn your ShaKey into a custom game controller!
|Parts Used in This Guide|
Step 1 Open up the example sketch
Over in the Arduino IDE, you'll find an example sketch called 'Factory'.
It can be found under File > Examples > Examples for Little Bird Shakey > Shakey > Factory
This is the sketch that is already programmed to the ShaKey out of the box. If you run into any errors, it can be re-uploaded to the ShaKey.
It can also be used to change the input keys to your liking!
Step 2 Create a new Arduino sketch
To keep the factory sketch as is, create a new Arduino sketch.
Then copy and paste the factory sketch into the new sketch file.
Copy 'settings.h' and paste it into a new sketch as well. Make sure its extension is '.h' and not '.ino'!
Step 3 Place new settings.h file into same directory
For the code to work, the new 'settings.h' file needs to be in the same directory as the new sketch file!
So place it in the same directory as shown.
Step 4 Change the input keys
In this new sketch, the inputs for up, down, left and right are kept the same.
Four inputs on the right hand side of the ShaKey have been changed to 'z', 'x', 'c' and the return key, 'KEY_RETURN'.
For a full list of key codes, scroll down to the bottom of the sketch. They should be in grey, this means they are comments.
Step 5 Change noise cancellation values
You might also want to change the values for 'SWITCH_THRESHOLD_OFFSET_PERC' and 'SWITCH_THRESHOLD_CENTER_BIAS'
Changing these changes how hard it is to 'press' and 'release' keys.
Step 6 Upload to the ShaKey
Save the new settings.h file, and re-upload the new ShaKey sketch file, 'ShaKey-remap.ino'.