Keymap module

load_from_file

procedure2 overloadsSource

Reads bindings from a file into the set, in the format of load_from_memory. Returns false when the file cannot be read or has an invalid line. With optional, a missing file is not an error.

Example↗
set: Keymap_Set;
map := add_keymap(*set, "game");
set.default_keymap = map;
add_proc(map, "jump", () { /* ... */ });
load_from_file(*set, "keys", "keys.txt", optional = true);

This one is only checked to compile, not run.

load_from_file :: (
    set: *Keymap_Set,
    short_name: string,
    filename: string,
    optional := false
) -> bool

Parameters

short_name: string
filename: string
optional := false

Returns

bool
load_from_file :: (
    keymap: *Keymap,
    short_name: string,
    full_path: string,
    optional := false
) -> bool

Reads bindings from a file into one keymap, ignoring [section] lines.

Parameters

keymap: *Keymap
short_name: string
full_path: string
optional := false

Returns

bool

See also