Background:
I’m attempting to setup a Cherry LPOS g86-71400 keyboard to act as a custom operator keyboard within Ignition. The end goal is to mimic the functionality of the existing Honeywell control system that Ignition is replacing, which allows quick access to certain windows via dedicated keys.
This Cherry keyboard has a set of re-legendable, re-mapable keys. I can configure specific hex codes, or a macro of several codes, to any key using the Cherry Designer software. The keyboard configuration is then written to the board firmware.
Issue:
When setting up a Keystroke Client Event Script, you can only select by the keycode or the character (plus modifiers). The keycode selection list seems to match the corresponding java Key Code Enum: https://docs.oracle.com/javafx/2/api/javafx/scene/input/KeyCode.html
I’d like to make use of some dead keycodes, but can’t locate the matching hex values that I need to assign to my keyboards keys. Is there a listing of what hex values the Java KeyCode items map to? Or is there a way using reflection to find those hex codes with a script?
Thanks for the link, that’s exactly what I was looking for!
Unfortunately, the constants I was aiming to use aren’t available in the Cherry Designer software and some codes that ARE available aren’t listed in the java constants…
Is it possible to attach a key event handler for a non-standard key code through scripting?
Thinking similar to this post though available across multiple desktops, not a specific component.
For reference, these are the hex and integer codes I’m looking to use:
My initial plan was to map those custom keys to a combo of some modifiers + F keys. Like (LCtrl+F10) for the key above F10. After making that configuration change, however, it seemed the delay between keys in the macro was too much to register as one singular event, so Ignition couldn’t pick it up.
You’ll have to translate the Java to Jython, but it’s not that hard - make a new Python class that inherits from KeyEventDispatcher and contains a dispatchKeyEvent function - you’ll need to import KeyboardFocusManager and KeyEventDispatcher from their respective Java packages as well.
Thanks for your help @PGriffith, I was able to successfully attach the event dispatcher and find some usable Key Codes through trial and error
The strange codes reported in Cherry Designer were actually for some common utility keys: Home, Insert, etc… I’m guessing their driver handles the mapping to the proper code?
I placed this code in the action event script of a button on a test page:
I eventually found the range of hex codes that map to the F13+ keys, which is suitable for our usage.
For any future searchers: if you don’t include the try block and your event code errors out, you’ll break the key event handler stack and lose the use of your keyboard in the designer