Generic Devices: Success!

Hi Andreas, @here,

Just reporting in to say a huge "thanks" for this features which, with a little tinkering, has brought back my beloved XKeys80 back from oblivion! No other keypad/keyboard combination has quite fitted my workflow so well, and I've done without it since OSX something killed ControllerMate.

I have all the keys successfully mapped for key presses - can I get a consult on the best way to tackle function keys, which need to have press and release mapped? Should I use BTT variables to store which keys are currently down and, if so, can I get/set them from the GD script? Or can I get the system report about which keys are currently down?

Thanks again,


Looks like a very interesting device!

Can you give some more information about the F keys? Are their changes shown in the GD script?
You can use btt variables - to retrieve them you can use something like this:

let value = await callBTT('get_string_variable',{variableName:'theVariableName'})

However this is relatively slow. If you just need to store information, you can create a global variable before the analyzeDeviceInput function. Have a look here:

Generic Devices: Please give function analyzeDeviceInput() access to the previous state - Feature Requests - BetterTouchTool Community (

Thanks Andreas,

I've not explained myself very well - all of the keys are of the same type, but what I want to do is to map some to Ctrl/Option/Shift/Cmd. So I need them to be "held down" and not momentary, and need the key-down and key-up to be captured.

The solution by Back-To-Topic has proved a winner - I have adapted it for the Xkeys and all working perfectly - thanks both!


Great to hear!

I'll soon be creating a collection of user created device support scripts - if you want to share yours I'd definitely include it too!