A space cadet (pass through on tap, on/off on pressed+other keys) that turns a handler on/off. Note that this needs to be before the handler it toggles in the handler order, so you need to use keyboard.add_handler(space_cadet_handler(trigger, keyboard.future_handler_id(2))); keyboard.add_handler(Box::new(Layer(...)))
(
trigger: impl AcceptsKeycode,
action: KeyCode,
id: HandlerID,
)
| 225 | /// keyboard.add_handler(Box::new(Layer(...))) |
| 226 | /// |
| 227 | pub fn space_cadet_handler( |
| 228 | trigger: impl AcceptsKeycode, |
| 229 | action: KeyCode, |
| 230 | id: HandlerID, |
| 231 | ) -> Box<SpaceCadet<KeyCode, ActionHandler>> { |
| 232 | Box::new(SpaceCadet::new(trigger, action, ActionHandler { id })) |
| 233 | } |
| 234 | /// Handler for turing Copy/Paste/Cut Keycodes into 'universal' |
| 235 | /// Ctrl-Insert, Shift-insert, shift-delete keystrokes |
| 236 | /// for dedicated copy paste keys |
no outgoing calls