robot-1.1: Simulate keyboard and mouse events

Safe HaskellNone

Test.Robot.Types

Contents

Description

Defines the Key and Button types, along with a list of constants of those types.

Synopsis

Types

data Key Source

A key on the keyboard.

data Button Source

A mouse button or scroll wheel.

Note that the scroll wheel is treated as two separate buttons: one scrolling up, and one scrolling down.

Creating

These two functions let you define your own keys and buttons.

customKey requires a magic number (keysym) as its argument. On most Unix systems, you can look up common keysyms in the file /usr/include/X11/keysymdef.h.

For example, the pound sign £ is listed as:

 #define XK_sterling                      0x00a3  /* U+00A3 POUND SIGN */

so to input this key, we use customKey 0x00a3.

Note: this feature only works if the key actually exists on your keyboard. If not, then using the result will raise an exception.

Extracting

rawKey :: Key -> KEYSYMSource

Retrieve the internal identifier for this key.

rawButton :: Button -> BUTTONSource

Retrieve the internal identifier for this button.

Constants

Buttons

Control sequences

Cursor control and motion

Miscellaneous functions

Keypad functions

Keypad numbers

Function keys

Modifiers

More modifiers

Letters, numbers and symbols