JS9 supports the actions that get executed in response to (case-sensitive) keypress events. The following actions are defined in the JS9.globalOpts.keyboardActions array:
It is possible to add new actions. To do this, first add an entry to the JS9.Keyboard.Actions object. The property name for the new entry should be descriptive text, like that which is found in JS9.globalOpts.keyboardActions. The property value will be a function having the calling sequence:
function(im, ipos, evt)where:
JS9.Keyboard.Actions["export image as a PNG file"] = function(im, ipos, evt){ .... action implementation goes here ... };Once this new action property has been defined, you can map it to a keypress event in JS9.globalOpts.keyboardActions:
JS9.globalOpts.keyboardActions["x"] = "export image as a PNG file";The new action will be shown in the Keyboard plugin display, and will be executed any time the "x" key is pressed.