Keymap module

map_string_to_key

procedureSource

Turns a key name or a single character into a Key_Code. Returns false for a name it does not know.

Example↗
#import "Input";

ok, key := map_string_to_key("F5");
assert(ok && key == .F5);
ok, key = map_string_to_key("a");
assert(ok && key == cast(Key_Code) #char "A");
map_string_to_key :: (s: string) -> (bool, Key_Code)

Parameters

s: string

Returns

bool

See also