Key Scripter
AboutInstallationSetupUsageCreating scriptsDownloads

Usage

Key Scripter supports the following command-line parameters:Any values specified on the command line, not equal to the supported parameters, are interpreted as configuration commands. This makes it possible to specify a configuration directly on the command line without using a file.

If no input is specified, Key Scripter will read from the standard input. This allows piping key press/release events from another program or script, instead of letting Key Scripter read directly from a device. Data read from the standard input is handled differently than raw data from a device. While a device file can only supply a press or a release event, data from the standard input may contain several more command types. Each command starts with a character identifying it, is usually followed by one or more parameters such as a positive number, and is terminated by a new-line character. The following types of commands are supported (values between {} represent a positive number):A t{scancode} command is handled exactly as the following three commands one after another: p{scancode}, s75, r{scancode}. Mouse button numbers start with 1, with 2 being the right mouse button and 3 the middle. An mc{number} command is handled exactly as the following three commands one after another: mp{number}, s75, mr{number}. Key and mouse event commands also support the following notation: p{scancode}/{milliseconds}, which is handled exactly as the following two commands one after another: s{milliseconds}, p{scancode}.

For example, the following line instructs Key Scripter to type 'hi' on the current display:

On Linux:echo -e "t43\nt31\nq" | key-scripter -o -w
On Windows:echo t43 > tmp && echo.>> tmp && echo t31 >> tmp && echo.>> tmp && echo q >> tmp | key-scripter -o < tmp

When no output is specified, Key Scripter will print key events that it would otherwise send to a display, to the standard output. Here again the same format is used as when reading from the standard input. However, only key and mouse event commands are generated.

For example, the following line instructs Key Scripter to listen to an input device and print received key events to the standard output:

On Linux:key-scripter -i=/dev/input/event2
On Windows:key-scripter -i

When no configuration file is specified, Key Scripter will pass each received key event as is, either to the specified display or, when no display is specified, to the standard output. With a configuration file available, Key Scripter will only react to those key events that are specified in the configuration. See Creating scripts to find out how to write configuration files.