t2:key_get

key_get


key_get — Get output value of a keyboard key

Description


bool key_get(uint8 code);

Get the current value, pressed or not pressed, of the output key specified by code.

The key_get() returns the value set by key_set() and/or key_passthru().

Parameters


  • code: Code of a keyboard key. Refer to keyboard.gph for the key codes definitions.

Return Value


Returns true if the output key is pressed, FALSE otherwise.

Examples


Example #1 key_get() example

#include <keyboard.gph>
 
main {
    key_passthru();
 
    if(key_get(KEY_RIGHTSHIFT)) {
        set_val(BUTTON_5, 100.0);
    }
}

See Also

t2/key_get.txt · Last modified: 2018/02/20 08:21 by J2Kbr