euporie.core.key_binding.key_processor

Modify the KeyProcessor to remove any timeout after an escape key press.

Functions

get_app()

Get the current active (running) Application.

Classes

KeyPress(key[, data])

KeyProcessor(*args, **kwargs)

A subclass of prompt_toolkit's keyprocessor.

Keys(*values)

List of keys for use in key bindings.

MoreKeys(*values)

Additional key definitions.

PtKeyProcessor

alias of KeyProcessor

class euporie.core.key_binding.key_processor.KeyProcessor(*args: Any, **kwargs: Any)

Bases: KeyProcessor

A subclass of prompt_toolkit’s keyprocessor.

This adds an exception to the auto-flush timeout so that the input is flushed immediately if the key pressed is the escape key.

await_key(key: Keys | MoreKeys, timeout: float = 1.0) None

Wait for a particular key, processing it before all other keys.

Parameters:
  • key – The key to wait for

  • timeout – How long to wait for the key, in seconds

empty_queue() list[KeyPress]

Empty the input queue. Return the unprocessed input.

feed(key_press: KeyPress, first: bool = False) None

Add a new KeyPress to the input queue. (Don’t forget to call process_keys in order to process the queue.)

Parameters:

first – If true, insert before everything else.

feed_multiple(key_presses: list[KeyPress], first: bool = False) None
Parameters:

first – If true, insert before everything else.

process_keys() None

Process all the keys in the input queue.

reset() None
send_sigint() None

Send SIGINT. Immediately call the SIGINT key handler.