How to add a Calculator key in Chrysalis

Posting this as a quick guide, because I spent a little while figuring it out and someone might find it useful.

After many years of faithful service, my last remaining MS Natural 4000 has finally died. This has given me the push to get my Model 100 properly configured. One of the minor usability features of the MS keyboard was a dedicated key to open the calculator - something I used far more than I would have expected, and thus wanted to add to my layout.

It turns out that the Calculator key sends a key code that is part of the Consumer HID key code spec, along with things like volume and media control keys. Kaleidoscope has them all included, which you can view here.

So I just had to add the correct key code for HID_CONSUMER_AL_CALCULATOR in the Advanced tab, which is 0x0192 plus the code page offset. Rather than work that out from the code base, I cheated and looked at the key code for one of the predefined media buttons. From that I found the offset for HID_CONSUMER keys is 0x4800.

From that, we get 0x4800+0x0192 = 0x4992 = 18834. Putting that into the custom key code box, sure enough, I now have a calculator button!

Anyway you could use the same process to add any of the other consumer keys in the definition file, but it’ll be up to your OS as to whether they do anything (i.e. probably not). Might be handy for a layer to control media devices, though.

2 Likes