I am trying to simulate the keyboard stroke. When I press the - key, I receive the following event.
What does the various codes mean?
[KEY_PRESSED, keyCode=45, keyText=Minus, keyChar='-', keyLocation=KEY_LOCATION_STANDARD, rawCode=189, primaryLevelUnicode=45, scancode=12]
KEY_PRESSEDis the event type.keyCodeis the code as integer of the key. Note that not all characters have a keycode associated with them. For example, there is no keycode for the question mark because there is no keyboard for which it appears on the primary layer. You can get a list of each code here.keyTextis the text description of the character.keyCharis the typed char.keyLocationis the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys.primaryLevelUnicodeI believe this is the chart used to map the characters. Unicode have multiple levels of chart mostly usefull for comparison (collator).scancodeare sent to the computer to identify the key. See this answer for more details. You can get a list of scan codes here.Note that the
scancodeseems to be for MS Windows only as per comment inKeyEvent: