ui_process_key_pressed#
- 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.
- 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.
- press_backspace()[source]#
Default behavior:
Delete character backwards in the line editor. Also move cursor to the left.