KeyMap(3U)
π KeyMap(3U) β it's giving "press a key, get a control" energy π
okay bestie, welcome to the InterViews Reference Manual, Unidraw chapter, and today's main character is KeyMap β the lil guy that activates controls given their keyboard equivalents. π¦
β¨ SYNOPSIS β¨
#include <Unidraw/keymap.h>
like, that's it. that's the include. go off. π
πΈ DESCRIPTION πΈ
so KeyMap supports keyboard equivalents, which is the whole vibe where the user of a Unidraw application can execute menu commands or select from a palette of controls by typing instead of pointing and clicking with the mouse. no cap, keyboard supremacy. β¨οΈπ
The KeyMap can activate a control given its key code as defined by its ControlInfo object. Only those controls registered with the KeyMap can be activated through the KeyMap β so if you didn't register, you're not getting in, it's giving exclusive guest list. π
By default, the Editor base class handles key events by having its KeyMap execute the key code. default behavior, iconic, no notes. β¨
π PUBLIC OPERATIONS π
KeyMap()β construct a new keymap, initially with no registrants. brand new, empty, zero friends, we love a fresh start. πvoid Register(UControl*)void Register(KeyMap*)void Unregister(UControl*)void Unregister(KeyMap*)β register and unregister a control or another KeyMap. Registering a KeyMap is equivalent to registering all its registered controls individually β like, it's a whole friend group joining the party at once, slay. π«Άvoid Execute(const char* keyCode)β execute the given key code by activating the corresponding control. EachUControlcontains aControlInfoobject that specifies its key code; thus the mapping between key codes and controls is defined by theControlInfoobjects collectively. so it's a team effort fr fr. π€
β οΈ bestie listen: key codes among registered controls should be unique. two controls claiming the same key code is not the moment, it's a vibe check failure. π
π SEE ALSO π
ControlInfo(3U), KeyMap(3U), UControl(3U), kybd(3U)
(yes it references itself, that's just self-love, periodt. π)
Unidraw Β· 1 August 1990 β ok that's the whole page, mwah π thanks for coming to my ted talk, go register some controls and stay hydrated bestie πβ¨π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms