functions to change state when the keyboard is reloaded; instead,
pass it as an event.
(cherry picked from commit 7e653f806ff5508aace059312156f319a9ed4479)
Leaving xpr unflattened since we want modularity to replace that with xpc (XPluginComposite) at some point
(cherry picked from commit 48e6a75fbdd0fee86e364f02ace83f20b312a2b2)