Shortcuts are sometimes initiated from a keycode event, and sometimes from a text input event. Move the handling to a unique function.
Shortcuts are sometimes initiated from a keycode event, and sometimes from a text input event. Move the handling to a unique function.