Command Map

class urwid.CommandMap

dict-like object for looking up commands from keystrokes.

Default values:

tab, ctrl n

'next selectable'

shift tab, ctrl p

'prev selectable'

ctrl l

'redraw screen'

esc

'menu'

up, down, left, right

'cursor up', 'cursor down', 'cursor left', 'cursor right'

page up, page down

'cursor page up', 'cursor page down'

home, end

'cursor max left', 'cursor max right'

space, enter

'activate'

Initialize the command map with the class’s default key-to-command bindings.

clear_command(command: str | Command) → None

Remove every keystroke currently mapped to command.

copy() → Self

Return a new copy of this CommandMap, likely so we can modify it separate from a shared one.

restore_defaults() → None

Reset the command map to the class’s default key-to-command bindings.