Keyboard

Methods to use the keyboard.


TKeyboard

Main record responsible with handling Keyboard input.


Keyboard.Setup

procedure TKeyboard.Setup();

Sets up internal TKeyboard values.

This is automatically called for you on the Keyboard variable.


Keyboard properties

The following are some of the properties that TKeyboard has available to control it’s behaviour.


Keyboard.PressMin

property TKeyboard.PressMin: Integer;
property TKeyboard.PressMin(value: Integer);

Get/Set TKeyboard PressMin value.

Basically the minimum time the TKeyboard keys will be held when typing.

When typing the keys will be held a random time between TKeyboard.PressMin and TKeyboard.PressMax.


Keyboard.PressMax

property TKeyboard.PressMax: Integer;
property TKeyboard.PressMax(value: Integer);

Get/Set TKeyboard PressMax value.

Basically the minimum time the TKeyboard keys will be held when typing.

When typing the keys will be held a random time between TKeyboard.PressMin and TKeyboard.PressMax.


Keyboard.KeyDown

procedure TKeyboard.KeyDown(key: EKeyCode);

Presses down the given virtual key.


Keyboard.KeyUp

procedure TKeyboard.KeyUp(key: EKeyCode);

Releases the given virtual key.


Keyboard.KeyPress

procedure TKeyboard.KeyPress(key: EKeyCode);

Presses the given virtual key.


Keyboard.IsKeyDown

procedure TKeyboard.IsKeyDown(Key: EKeyCode);

Returns True if the given virtual key is currently down.


Keyboard.Send

procedure TKeyboard.Send(text: String);
procedure TKeyboard.Send(text: String; keyPressAfter: EKeyCode); overload;

Writes the given text to whatever window is currently in focus.

First overload allows you to pass KeyWait, KeyModWait, and KeyPressWait, all are timing modifiers. Last overload allows you to pass a long a key to be pressed after the text has been typed, for example VK_ENTER.


Keyboard variable

Global TKeyboard variable.