Script hooks - keypress



Keypress events are triggered when a key is pressed while an editor view has keyboard focus. Currently (v1.4) the number keys will trigger these events. Here is a listing of the information that can be obtained in scripts triggered by a keypress event.


string getHookEventName()
This function returns a text identifier for the event that the script was triggered by, or empty string if the script was not triggered by an event. For keypress events, the value returned will be one of:

bool isCtrlKeyDown()
Returns true if Ctrl was pressed when the event was triggered, otherwise it will return false.


bool isAltKeyDown()
Returns true if Alt was pressed when the event was triggered, otherwise returns false.