Keyboard Typing Simulation

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Keyboard Typing Simulation >

Keyboard Typing Simulation

GEK. - Get Extended Key-State

Previous Top Next


MiniRobotLanguage (MRL)

 

GEK. Command

Get Extended Key-State

 

 

Intention

 

The GEK.-Command has two modes of operation.

 

In Mode 1, it can be used to get the state of NUMLOCK, CAPSLOCK and SCROLLLOCK.

What you get is really the "state of the keyboard". Not "the state of the button".

GEK.-returns the "real thing", not just the key-states that you will get with GKS.

The keystates from GES. just show you, if actually the NUMLOCK-Key is up or down. GEK. will really get the state of the keyboard about NUMLOCK, CAPSLOCK, SCROLLLOCK etc. When choosing between GKS. and GEK. you need to understand the difference between these commands.

 

In Mode 2, it can be used to retrieve the state of the SHIFT, CTRL or the ALT-Key and others, see list below. In this case you really check whether the given Key is down or not.

 

Note: Even if CAPSLOCK is activated, you will get a "0" if you check for SHIFT, because that key is actually not down itself.

 

You can read more about Keyboard-Simulation and Text-Boxes in the chapter:

1.9.1.6 Edit-Textbox Control

 

 

 

Syntax

 

GEK.P1[|P2]

 

 

Parameter Explanation

 

P1 - VAR or numeric

 

P2 - (optional) Variable. If omitted TOS is used for result.

 

Parameter-List for P1:

 

SHIFT         - any shift key (keyboard Shift-state)

LSHIFT        - only left Shift-Key

RSHIFT        - only right Shift-Key

STRG,CTRL     - any Ctrl key (keyboard Ctrl-state)

LSTRG,LCTRL   - only left Ctrl-Key

RSTRG,RCTRL   - only right Ctrl-Key

MENU,ALT      - any ALT key (keyboard ALT-state)

LMENU,LALT    - only left ALT-Key

RMENU,RALT    - only right ALT-Key

NUMLOCK,NUM   - keyboard NUMLOCK-State

CAPSLOCK,CAPS - keyboard CAPSLOCK-State

SCROLLOCK,SCROL,SCROLL - keyboard SCROLLLOCK-State

 

 

 

Example

 

'*****************************************************

' EXAMPLE 1: GEK.

'*****************************************************

' Please run this script only in the editor

' Then press the SHIFT-Key (left or right) while its running.

DOL.1

 GEK.SHIFT|$$OUT

 DBP.$$OUT

OOP.

 

'*****************************************************

' EXAMPLE 2: GEK.

'*****************************************************

' Please run this script only in the editor

' Then press the NUMLOCK-Key (left or right) while its running.

DOL.1

 GEK.NUM|$$OUT

 DBP.$$OUT

OOP.

 

'*****************************************************

' EXAMPLE 3: GEK.

'*****************************************************

' Please run this script only in the editor

' Then press the SHIFT-Key (left or right) while its running.

DOL.1

 GEK.CAPSLOCK

 DBP.$$000

OOP.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.9.1.6 Edit-Textbox Control

    ! Keyboard-Keycode-List

    SEK. - Set Extended Key-State

    GKS. - Get Key-State

    SKP. Send-Key-Press

    SKT. - Send-Key-Text

    KYD. - Key Down

    KYU. - Key Up

    RST. - Replace Selected Text

    SDT. - SenD-window-Text