Keyboard Typing Simulation

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Keyboard Typing Simulation >

Keyboard Typing Simulation

KBC. / KBI.- Keyboard Command

Previous Top Next


MiniRobotLanguage (MRL)

 

KBC./KBI. Command

Keyboard Commands

 

Compatible Engine_01

 

Intention

 

The KBC.-Command can be used to simulate Keyboard typing. The Command has multiple predefined options and makes automated typing easier for you. Using KBC. you - for example - can mark all text in an Textbox. Or you can delete all Text in a Textbox.

It generally uses the compatible Engine.

 

The KBI.-Command works exactly as the KBC.-Command but uses another Typing-Technology that is faster, yet sometimes not as compatible.

KBI. will put things directly into the Keyboard-Input Buffer so typing is faster

 

So possibly try using the KBI. - because its faster - and if it does not work just use KBC.

 

There are currently these options:

 

' This option will mark all text in the currently localized text-control or web-control

' will work in Firefox or internet explorer

KBC.mark all

 

' This option will mark and delete all text in the currently localized text-control or web-control

' will work in Firefox or internet explorer

KBC.del all

 

' This option will read all text in the currently localized text-control or web-control

' will then compare to the text given as P2 (here $$TXT).

' If they do NOT match then it will delete this text and type the text from P2

$$TXT=Password

KBC.Type If|$$TXT

 

The following options simulate the Keyboard:

 

 KBC.Copy    -> -> strg-c

 KBC.Copy All -> strg-a strg-c

 KBC.Paste   -> strg-v[|n] n - is a number that will specify how often to press strg-v

 KBC.Paste Over -> strg-a strg-v

 KBC.Cut     -> strg-x

 KBC.Cut All -> strg-a strg-x

 KBC.Repeat  -> strg-y[|n] n - is a number that will specify how often to press strg-y

 KBC.Undo    -> strg-z[|n] n - is a number that will specify how often to press strg-z

 KBC.Italic  -> strg-i

 KBC.Bold    -> strg-b

 KBC.Underline  -> strg-u

 KBC.from Right[|n] -> {END} (Number of {RIGHT})

 KBC.from Left[|n] -> {HOME} (Number of {LEFT})

 KBC.Mark from Right[|n] -> {HOME}{SHIFT} (Number of {RIGHT})

 KBC.Mark from Left[|n] -> {END}{SHIFT} (Number of {LEFT})

 KBC.Mark to Right -> {HOME}{SHIFT}

 KBC.Mark to Left -> {END}{SHIFT}

   
There is a new series of H-XXXX Commands.

These commands use {HOME}{SHIFT}{END} instead of strg-a

to mark the complete Text in a Textbox. This is in some cases more compatible. There are:

 

  KBC.H-Copy All

 KBC.H-Mark All

  KBC.H-Del All

 KBC.H-Cut All

 KBC.H-Paste Over

 

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

    KBC. 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

 

KBC.P1[|P2]

 

 

Parameter Explanation

 

P1 - Prototype any of these:

 

 KBC.Type If   -> will read the text at the currently localized place and compare it with P2.
   If they do not match it will make "del all" and type the new text just like SKP. would.

 KBC.Mark All  -> this will click into and type ctrl-a to mark the whole content of a browser-
   or textcontrol that is currently localized.

 KBC.H-Mark All  -> this will click into and type {SHIFT} {HOME} {END} to mark the whole content
   of a browser- or textcontrol that is currently localized.

 KBC.Del All   -> will call "mark all" and then type a Backspace just like SKP.{BS}.
  This should delete all content of a text-control even in a browser.

 KBC.H-Del All   -> will call "h-mark all" and then type a Backspace just like SKP.{BS}.
  This should delete all content of a text-control even in a browser.

 KBC.From Left  -> will click into the Textbox, type "HOME" to go to left side.
   Then type "RIGHT" as many times, as the P2-Parameter specifies.

 KBC.From Right  -> will click into the Textbox, type "END" to go to right side.
   Then type "LEFT" as many times, as the P2-Parameter specifies.

 KBC.Mark from Left  -> will click into the Textbox, type "HOME","SHIFT" to go to left side.
   Then type "RIGHT" as many times, as the P2-Parameter specifies.

 KBC.Mark from Right  -> will click into the Textbox, type "END","SHIFT" to go to right side.
   Then type "LEFT" as many times, as the P2-Parameter specifies.  

 KBC.Copy       -> strg-c

 KBC.Copy All   -> strg-a strg-c

 KBC.H-Copy All   -> like "h-mark all" and "strg-c"

 KBC.Paste      -> strg-v[|n]

 KBC.Paste Over -> strg-a strg-v

 KBC.H-Paste Over -> like "h-mark all" and "strg-v"

 KBC.Cut        -> strg-x

 KBC.Cut All    -> strg-a strg-x

 KBC.H-Cut All  -> like "h-mark all" and "strg-x"

 KBC.Repeat     -> strg-y[|n]

 KBC.Undo       -> strg-z[|n]

 KBC.Italic     -> strg-i

 KBC.Bold       -> strg-b

 KBC.Underline  -> strg-u

 KBC.Mark to Left  -> "SHIFT" + "Home" (no Click)

 KBC.Mark to Right  -> "SHIFT" + "END" (no Click)

 

 

P2 - (optional) Depending on the Subcommand you can specify a second Parameter.
            With "Type If" this is a Text, with other Subcommands, this will be a number "how often"
            to repeat the specified Typing-Action. If P2 is omitted, it is assumed to be 1.  

 

 

 

Example

 

' Samples for KBC.

KBC.mark all

KBC.del all

KBC.Type If|Login-Text

KBC.Paste|5

KBC.from Left|6

END.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    1.9.1.6 Edit-Textbox Control

    ! Keyboard-Keycode-List

    SKP. Send-Key-Press

    KYD. - Key Down

    KYU. - Key Up

    RST. - Replace Selected Text

    SDT. - SenD-window-Text

    WNK. - Wait-No-Key

AGR. - Accessibility Get Rect