<< Click to Display Table of Contents >> Navigation: 3. Script Language > Keyboard Typing Simulation > Keyboard Typing Simulation |
MiniRobotLanguage (MRL)
IKS./NKS. Conditional Statement
If Key-State
Intention
The IKS.-Command can be used to find out if a specified key on the keyboard is actually pressed or released. Unlike IEK., the IKS.-Command will evaluate the state of the physical keyboard key, and tell you if its up or down and react on that.
IKS. has three modes of operation. In the first Mode, you can specify the button using all of the Low-Level Keycodes see here:
In the second Mode, you can type a # followed by a decimal number or variable that contains the number. Like this:
' This will check the state of the left SHIFT-Key
IKS.#160
DBP.$$RES
EIF.
' This will get the state of the left SHIFT-Key
' You can omit the {} here if you want.
IKS.SHIFT|
DBP.$$RES
EIF.
' This will get the state of the left SHIFT-Key
IKS.{SHIFT}
DBP.$$RES
EIF.
In the third Mode, you define the key directly, using "a" or "B". Here is an example:
' This will get the state of the a-Key
IKS."a"
DBP.$$RES
EIF.
You can read more about Keyboard-Simulation and Text-Boxes in the chapter:
Syntax
IKS.P1[|P2]
Parameter Explanation
P1 - VAR or numeric, or Keycode see below.
For P1, you can use all Low-Level-Keycodes: see here:
Example
'*****************************************************
' EXAMPLE 1: GKS.
'*****************************************************
' Run this example from the editor and
' press the "a" button while its running
'
DOL.1
IKS."A"
GTO.out
EIF.
OOP.
:out
ENR.
Remarks
-
Limitations:
-
See also:
• 1.9.1.6 Edit-Textbox Control
• GEK. - Get Extended Key-State
• SEK. - Set Extended Key-State
• RST. - Replace Selected Text
•