|
C-Menu 0.2.9
A User Interface Toolkit
|
NCurses UI backend — input handling. More...
#include "cm.h"#include "ui_backend.h"#include "ui_ncurses_internal.h"#include <poll.h>#include <stddef.h>#include <string.h>#include <termios.h>Go to the source code of this file.
Functions | |
| void | ui_flush_input () |
| Flush any pending input events from the NotCurses context. This function discards any input events that have been queued but not yet processed. | |
| int | ui_get_event (UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms) |
| Read input events. | |
| int | ui_get_event_no_mouse (UiSurface *s, ss_t w, UiEvent *ev) |
Wait for an input event on target (or stdscr if NULL) without mouse support. | |
| int | ui_mice_enable (int mask) |
| Enable or disable mouse support. | |
| int | ui_mousemask (int mask) |
| Enable or disable mouse support. | |
NCurses UI backend — input handling.
Translates raw NCurses key codes and mouse events into the portable UiEvent representation defined in ui_backend.h.
Definition in file ui_ncurses_input.c.
| void ui_flush_input | ( | ) |
Flush any pending input events from the NotCurses context. This function discards any input events that have been queued but not yet processed.
Definition at line 102 of file ui_ncurses_input.c.
References ui.
Referenced by ui_get_event(), ui_get_event_no_mouse(), and view_init_input().
Read input events.
Wait for an input event from the NotCurses context.
| s | Surface - may contain multiple widgets (planes/panels) |
| w | Widget index (A surface may contain multilple widgets) |
| chyron | A zoned group of Actions or Commands |
| ev | Event data structure |
| timeout_ms | Timeout in milliseconds (0 for no wait, -1 for infinite wait). |
ev is NULL.| ui | UI runtime context. |
| target | Unused for NotCurses (events are global to the context). |
| ev | Output UiEvent structure. |
| timeout_ms | Milliseconds to wait; -1 = block indefinitely. |
ui or ev is NULL. Definition at line 116 of file ui_ncurses_input.c.
References UiEvent::bstate, UiEvent::ch, em0, em1, em2, ui_context_t::ext_fds, ui_context_t::ext_nfds, ext_fd_reg_t::fd, handle_signal(), UiEvent::in_win, UiEvent::key, UiEvent::mouse_action, UiEvent::mouse_inside, sig_received, SUB_SFC_MAX, ext_fd_reg_t::token_id, ui, ui_ctx, ui_display_error(), ui_flush_input(), ui_get_chyron_key(), ui_render(), UiEvent::x, and UiEvent::y.
Referenced by cf_accept(), field_editor(), form_post(), form_process(), get_cmd_char(), main(), menu_cmd_processor(), picker(), ui_action_disposition(), ui_answer_yn(), ui_display_error(), ui_perror(), and ui_timeout_prompt().
Wait for an input event on target (or stdscr if NULL) without mouse support.
| ui | UI runtime context (unused — event comes from the window). |
| target | Surface to read from, or NULL for stdscr. |
| ev | Output UiEvent structure. |
ev is NULL. Definition at line 234 of file ui_ncurses_input.c.
| int ui_mice_enable | ( | int | mask | ) |
Enable or disable mouse support.
| mask | Mouse event mask (0 to disable, non-zero to enable). |
Definition at line 274 of file ui_ncurses_input.c.
| int ui_mousemask | ( | int | mask | ) |
Enable or disable mouse support.
| mask | Mouse event mask (0 to disable, non-zero to enable). |
Definition at line 261 of file ui_ncurses_input.c.