Raw Key Filter

Tests if a raw key press is of a certain type

Syntax

result = Raw Key Filter Number (rawKey)
result = Raw Key Filter Printable (rawKey)
result = Raw Key Filter Navigation (rawKey)
result = Raw Key Filter Delete (rawKey)

Description

Takes a rawkey as returned from the Keyboard Raw Key command and tests if it's of the type specified. If it is then result is set to TRUE, if not it's set to FALSE.

Raw Key Filter Number
Tests if the raw key represents a number between 0-9.
Raw Key Filter Printable
Tests if the raw key represents any printable character. Includes all numbers, letters and punctuation.
Raw Key Filter Navigation
Tests if the raw key is a cursor movement key. Any raw key that returns TRUE from this filter will only move the cursor.
Raw Key Filter Delete
Tests if the raw key is a delete key such as forward delete or backspace. Any raw key that returns TRUE from this filter will possibly delete a character from the string editor.

These commands are useful if you only want to let certain key presses into your String Editor. For example to only input numbers, only pass raw keys to String Editor Input that return TRUE for 'Raw Key Filter Number'. You may also want to allow navigation keys and delete keys.

Eg.

int rawKey = Keyboard Raw Key
if Raw Key Filter Number (rawKey) or Raw Key Filter Navigation (rawKey) or Raw Key Filter Delete (rawKey)
    String Editor Input (rawKey)
end if

To test for specific key presses, you can use the Raw Key Ascii, Raw Key Scancode and Raw Key Char commands.

For more information on raw keys and working with the keyboard please refer to the Keyboard Input Guide.

See also the Keyboard Raw Key and Raw Key Ascii commands.

Table of contents