Stk.KeySourceUtils for managing keys.
key_is_mod k returns whether k is a modifier.
type keystate = {key : Tsdl.Sdl.keycode;mask : Tsdl.Sdl.keymod;mods : Tsdl.Sdl.keymod;pred : Tsdl.Sdl.keymod -> bool;}A keyboard state corresponds to a key state if the specified key is pressed and the active modifiers after applying mask are equal to mods. mods is not used directly but instead a predicate is built to handle modifiers having left and right variants. mods is kept only for printing or storing purpose. mask is used to keep only modifiers of interest. For example not containing Sdl.Kmod.caps results in ignoring the state of Caps Lock when testing. Modifiers with left and right variants are not concerned by the mask since they are handled in the predicate.
Set default mask used by keystate if no mask is specified in argument. Default is Tsdl.Sdl.Kmod.none. Sdl.Kmod.(reserved+mode).
Set default modifiers used by keystate if no modifier is specified in argument. Default is Sdl.Kmod.(reserved+mode).
Create a keystate from the given key. Optional parameters are:
mask to set the modifiers whose state will be ignored. If not specified, default_keymask is used.mods to set the required modifiers. If not specified, default_keymods is used.match_keys keystate ~key ~kmod returns true if the given key and modifier kmod maths the given keystate.