ui_process_key_pressed#

See UIProcessKeyPressedMixin.

class zelfred.ui_process_key_pressed.UIProcessKeyPressedMixin[source]#

This class implements the key pressed event processing logics.

Important

All methods whose names start with process_ are abstract methods that handle specific key press events. They implement the Default behavior:. Experienced developers can override them to customize the behavior.

cursor_up_and_down()[source]#

A helper method should be called after the cursor moves up or down.

  • need_run_handler: False, the user input query is not changed, so we

    don’t need to run the handler again.

  • need_move_to_end: True, the dropdown menu may change, so we need to

    move the cursor to the end of the line in the next event loop

  • need_clear_items: True, the dropdown menu may change, so we need to

    clear the dropdown menu.

  • need_clear_query: False, the user input query is not changed, so we

    don’t need to clear the user input query.

  • need_print_query: False, the user input query is not changed, so we

    don’t need to print the user input query.

  • need_print_items: True, the dropdown menu may change, so we need to

    print the dropdown menu.

  • need_process_input: True, we need to process the user input next time.

wait_next_user_input()[source]#

Don’t repaint

cursor_left_and_right()[source]#

A helper method should be called after the cursor moves left and right.

  • need_run_handler: False, the user input query is not changed, so we

    don’t need to run the handler again.

  • need_move_to_end: False, the dropdown menu is not changed, so we

    don’t need to move the cursor to the end of the line.

  • need_clear_items: False, the dropdown menu is not changed, so we

    don’t need to clear the dropdown menu.

  • need_clear_query: False, the user input query is not changed, so we

    don’t need to clear the user input query.

  • need_print_query: False, the user input query is not changed, so we

    don’t need to print the user input query.

  • need_print_items: False, the dropdown menu is not change, so we

    don’t need to print the dropdown menu.

  • need_process_input: True, we need to process the user input next time.

process_up()[source]#

Default behavior:

select the previous item in dropdown menu.

process_down()[source]#

Default behavior:

select the next item in dropdown menu.

process_ctrl_e()[source]#

Default behavior:

select the previous item in dropdown menu.

process_ctrl_d()[source]#

Default behavior:

select the next item in dropdown menu.

process_ctrl_r()[source]#

Default behavior:

scroll up the dropdown menu (press UP 5 times).

process_ctrl_f()[source]#

Default behavior:

scroll down the dropdown menu (press DOWN 5 times).

process_left()[source]#

Default behavior:

move user input cursor to the previous character.

process_right()[source]#

Default behavior:

move user input cursor to the next character.

process_alt_left()[source]#

Default behavior:

Move cursor to the beginning of previous word.

process_alt_right()[source]#

Default behavior:

Move cursor to the beginning of next word.

process_home()[source]#

Default behavior:

Move cursor to the beginning of the line.

process_end()[source]#

Default behavior:

Move cursor to the end of the line.

press_backspace()[source]#

Default behavior:

Delete character backwards in the line editor. Also move cursor to the left.

press_delete()[source]#

Default behavior:

Delete character forwards in the line editor. Also, the cursor stays.

process_ctrl_k()[source]#

Default behavior:

Delete the previous word.

process_ctrl_l()[source]#

Default behavior:

Delete the next word.

process_tab()[source]#

Default behavior:

Auto complete.

process_ctrl_x()[source]#

Default behavior:

Clear the user input.

process_ctrl_c()[source]#

Default behavior:

Keyboard interrupt.

process_enter()[source]#

Default behavior:

User action for enter.

process_ctrl_a()[source]#

Default behavior:

User action for CTRL A.

process_ctrl_w()[source]#

Default behavior:

User action for CTRL W.

process_ctrl_u()[source]#

Default behavior:

User action for CTRL U.

process_ctrl_p()[source]#

Default behavior:

User action for CTRL P.

process_f1()[source]#

Default behavior:

Jump out the sub-session, return to the previous view.

process_ctrl_t()[source]#

Default behavior:

Do nothing. This is reserved for user custom shortcut.

process_ctrl_g()[source]#

Default behavior:

Do nothing. This is reserved for user custom shortcut.

process_ctrl_b()[source]#

Default behavior:

Do nothing. This is reserved for user custom shortcut.

process_ctrl_n()[source]#

Default behavior:

Do nothing. This is reserved for user custom shortcut.