Keyboard Typing Simulation

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Keyboard Typing Simulation >

Keyboard Typing Simulation

SKP. - Send-Key-Press

Previous Top Next


MiniRobotLanguage (MRL)

 

SKP. Command

Send Key Press

 

Compatible Engine_01

 

Intention

 

The SKP.-Command can be used to simulate Keyboard typing. SKP. is like if you really type something into the keyboard. This makes it very compatible with real typing.

Please note that for Safety-of-Typing-Consideration SKP. can not be intermixed with - for example SEK.-Command.

There might be some some cases that will require the use of KYU. / KYD. and SDI.-Command. Use these if it will not work with SKP.

 

SKP. will work on any place, where you can also enter text using the keyboard.It will work also in browsers, Java- and WEB-based controls.

 

As it is just like if "somebody is really typing", it has all advantages and all limitations from that.

 

    The target control must have Input focus

    the target window must be in front

    you may need to wait a bit (PAU.0.5) after typing until the control is ready

    SKP. its slower then any direct engine command

    but its highly compatible

    it understands special keyboard-actions like ctrl- or Shift or Alt-Key (see below).

    It can not change the text of buttons or controls like SDT..

 

 

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

1.9.1.6 Edit-Textbox Control

 

 

 

Syntax

 

SKP.P1

 

 

Parameter Explanation

 

P1 - VAR or STRING can contain all Low-Level-Keycodes: see:

 

Keyboard-Keycode-List

 

SKP. understands additionally to these commands some special commands. To understand this better, let's see an example.

 

SKP.A{RETURN}

 

In this example, the SKP. will technically press each of the buttons and then release each of the buttons. Like this:

 

1. Press A

2. Release A

3. Press {RETURN}

4. Release {RETURN}

 

Now you may want to just press and hold a button down. And not release it immediately.

 

For example the SHIFT or the ALT-Button. This is done, by prefixing ANY of the Low-Level Key-code with a

 

{DN_...}   -  only push that button down

{UP_...}   -  only release that button

 

for example:

 

SKP.{DN_SHIFT}abc{UP_SHIFT}

 

will type:

 

ABC

 

in large letters, as we are holding down the SHIFT-Key in this example.

In the same way, you can open Menus or select menu-items.

 

 

Note:

 

1. To call Menu-Items using the Keyboard, prefer KYD. and KYU. especially if the CTRL, or ALT-Key is needed..

 

2. When combining Keys with SHIFT, always use small letters. Large letters will automatically be SHIFTED when typed.

 

3. When combining Keys with CTRL or ALT, things may not work as expected

  because safety of typing* will internally interfere with pre-pressed keys.

   Use KYD. and KYU. for such Combinations. .

 

4. SKP. will switch off CAPSLOCK and NUMLOCK before it starts typing. It will restore the previous state of CAPSLOCK and NUMLOCK when its ready with typing..

 

5. SKP. will do a complete variable-resolution. It will resolve Specialfolders as well as Systemvariables before it starts typing.

 

-------------

* Safety of typing. Internal process to make sure that no CTRL and other keys are pressed on the physical keyboard, while we are simulating keystrokes.

 

 

 

 

Example

 

SKP..$$TXT

SKP. Hallo

 

 

 

Remarks

 

If you need more control over the keyboard, you can use KYD. and KYU.

 

 

 

Limitations:

 

SKP. will generally type into the window that has the Input-Focus. Also the state of the SHIFT-Key or the SCROLLLOCK or the NUMLOCK-Key can influence SKP. Therefore don't type while SKP. is at work.

 

' Some things may not work with SKP. 

' For example: 

 

' This will not work, as SKP. internally will undo the Effects of SEK.

SEK.LALT|1

SKP.{NUM_1}{NUM_4}{NUM_4}

SEK.LALT|0

 

' This will work, as KYD. and KYU. are specially made for this.

KYD.{LALT}

KYD.{NUM_1}

PAU..1

KYU.{NUM_1}

PAU..1

KYD.{NUM_4}

PAU..1

KYU.{NUM_4}

PAU..1

KYD.{NUM_4}

PAU..1

KYU.{NUM_4}

KYU.{LALT}

 

' OR USE 

' This will also work

SEK.LALT|1

SDI.{NUM_1},{NUM_4},{NUM_4}

SEK.LALT|0

 

 

See also:

 

    1.9.1.6 Edit-Textbox Control

    ! Keyboard-Keycode-List

    SKT. - Send-Key-Text

    KYD. - Key Down

    KYU. - Key Up

    RST. - Replace Selected Text

    SDT. - SenD-window-Text

    SKT. - Send-Key-Text

    WNK. - Wait-No-Key