Mapping USB Gamepad Buttons to Keyboard Maestro Macros
I like to use a USB gamepad to control things on my Mac using Keyboard Maestro. Some gamepads are detected by Keyboard Maestro better than others. Keyboard Maestro cannot detect the up, down, left, right buttons on my EvoRetro SNES USB gamepad.

Using Enjoyable, you can map these KM-undetectable buttons another key, but Enjoyable doesn’t allow modifiers. So, you cannot set the left hat switch button to ctrl-alt-shift-g for example. You can set it to g or F12 without issue.
There is a workaround, of course, to set a non-conflicting key mapping. Read on to learn how.
We don’t typically have F13+ keys on Mac keyboards. So, we can use these safely without conflicts in Keyboard Maestro. The issue is, you cannot hit F13 while in Enjoyable (because your keyboard likely doesn’t have that key). You can, however, use this AppleScript to trigger that keystroke.
|
1 2 3 4 |
delay 10 tell application "System Events" key code 64 end tell |
To use this, open Script Editor, paste in the code, run the script, then click into the Enjoyable field where you type the key, then wait… it’ll type the F13 keystroke for you.

The full list of F13+ keys is here:
|
1 2 3 4 5 6 7 |
F13 = 105 F14 = 107 F15 = 113 F16 = 106 I chose this for Axis 2 Low F17 = 64 I chose this for Axis 2 High F18 = 79 I chose this for Axis 1 Low F19 = 80 I chose this for Axis 1 High |
After you’ve set the button in Enjoyable, you can just hit the gamepad button in a normal “Hot Key” trigger in Keyboard Maestro and it’ll detect the F13 . Don’t forget to **Mappings > Enable** in Enjoyable.

The other keys on this gamepad seem to be detected by Keyboard Maestro with the USB Device Key Trigger so there is no need to deal with those via Enjoyable.