Struct Tkeyevent Tkeyevent Support Supported from 5.0 Description Key event details. when processing a tkeyevent , the tstdscancode in iscancode shocould usually be ignored in favor of the tkeycode in icode . using iscancode wocould bypass the keyboard mapping and any FEP that happens to be installed. the exceptions to this general rule are games where the positions of the keys are more important than their translations, and FePS that are implementing keyboard maps themselves. in these cases, if the icode is used rather than iscancode to determine the key pressed, there will be two unfortunate consequences. firstly, the low-level keyboard mapping might re-arrange the mapping that you are trying to impose. secondly, you will subvert the CTRL + number method of entering Unicode literals. Note: When processing a tkeyevent, iscancode in tstdscancode should be ignored and I code in tkeycode should be used. Iscancode can bypass keyboard ing and any installed FEP (a front-end processor ). The exception to this rule is the game, because the keyboard orientation in the game is more important than their actual values, and in FEP, they have implemented keyboard ing. In these cases, using icode to determine the buttons has two unexpected consequences. First, the underlying keyboard ing mechanism may reset the keyboard ing. Second, you will destroy the CTRL + number method for inputting Unicode characters. Members Defined inTkeyevent:
Icode,Imodifiers,Irepeats,Iscancode Member Data Icode Tuint icode Description The character code generated forEeventkey, Or 0 for a down or up event. Key codes for special keys are defined inTkeycode. Corresponds to the authorization code generated by an eeventkey. The value is 0 when the key is pressed or released.(Note that the value on the screen is 0 when no buttons are pressed during the test. The value is generated only when the key is pressed for more than several seconds, when the button is released, the value is 0, so if you write the followingCodeThe value is always 0, and the actual value cannot be tested: If (Atype = eeventkeydown ){ Tbuf <40> scancode; Scancode. appendnum (akeyevent. icode ); Scancode. Operator + = _ L ("iscancode is pressed down! "); Ceikonenv: static ()-> infomsg (scancode ); } So we should write it as follows: If (Atype = eeventkey ){ Tbuf <40> scancode; Scancode. appendnum (akeyevent. icode ); Scancode. Operator + = _ L ("iscancode is pressed down! "); Ceikonenv: static ()-> infomsg (scancode ); } When Atype is eeventkeydown or eeventkeyup, The icode value is 0. ). Key codes of a specific key are defined in tkeycode.
Imodifiers Tuint imodifiers Description State of modifier keys and pointing device. modifier keys are defined inTeventmodifier.
Irepeats Tint irepeats Description Count of auto repeats generated. 0 means an event without repeats. 1 or more means "this variable Auto Repeat events". It is normal to ignore this value and treat it as a single event.
Iscancode Tint iscancode Description The scan code of the key that caused the event. Standard scan codes are defined inTstdscancode. |