euporie.core.terminal.KeyProcessor

class euporie.core.terminal.KeyProcessor(key_bindings: KeyBindingsBase)

Statemachine that receives KeyPress instances and according to the key bindings in the given KeyBindings, calls the matching handlers.

p = KeyProcessor(key_bindings)

# Send keys into the processor.
p.feed(KeyPress(Keys.ControlX, ''))
p.feed(KeyPress(Keys.ControlC, '')

# Process all the keys in the queue.
p.process_keys()

# Now the ControlX-ControlC callback will be called if this sequence is
# registered in the key bindings.
Parameters:

key_bindingsKeyBindingsBase instance.