|
C-Menu 0.2.9
A User Interface Toolkit
|
NotCurses UI backend — input handling. More...
#include "ui_backend.h"#include "ui_notcurses_internal.h"#include <errno.h>#include <notcurses/notcurses.h>#include <poll.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) |
| Wait for an input event from the NotCurses context. | |
| int | ui_get_event_no_mouse (UiSurface *target, ss_t w, UiEvent *ev) |
| Wait for an input event from the NotCurses context, ignoring mouse events. | |
| uint | ui_get_plane_idx (UiSurface *s, struct ncplane *plane) |
| Get the index of a given ncplane in the UiSurface's plane array. | |
| int | ui_getch () |
| Wait for a single input character from the NotCurses context. | |
| int | ui_mice_enable (int mask) |
| Enable or disable mouse events for the NotCurses context. | |
| int | ui_mousemask (int mask) |
| Set the mouse event mask for the NotCurses context. | |
| NcPlane * | ui_ncplane_clicked (UiSurface *s, ss_t w, ncinput *ni) |
| Determine which ncplane was clicked based on the mouse event coordinates. | |
NotCurses UI backend — input handling.
Translates NotCurses ncinput events into the portable UiEvent representation defined in ui_backend.h.
Definition in file ui_notcurses_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 105 of file ui_notcurses_input.c.
References ui.
Wait for an input event from the NotCurses context.
| 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 117 of file ui_notcurses_input.c.
References UiEvent::alt, UiEvent::ch, UiEvent::ctrl, ui_context_t::ext_fds, ui_context_t::ext_nfds, ext_fd_reg_t::fd, UiEvent::in_win, UiEvent::key, UiEvent::mouse_action, UiEvent::shift, ext_fd_reg_t::token_id, ui, ui_ctx, ui_flush_input(), ui_get_chyron_key(), ui_render(), UiEvent::x, and UiEvent::y.
Wait for an input event from the NotCurses context, ignoring mouse events.
Wait for an input event on target (or stdscr if NULL) without mouse support.
| target | Unused for NotCurses (events are global to the context). |
| ev | Output UiEvent structure. |
ui or ev is NULL. Definition at line 239 of file ui_notcurses_input.c.
References UiEvent::alt, UiEvent::ch, UiEvent::ctrl, UiEvent::key, UiEvent::shift, ui, and ui_flush_input().
| uint ui_get_plane_idx | ( | UiSurface * | s, |
| struct ncplane * | plane ) |
Get the index of a given ncplane in the UiSurface's plane array.
| s | The UiSurface containing the planes. |
| plane | The ncplane to find. |
Definition at line 263 of file ui_notcurses_input.c.
References SUB_SFC_MAX.
| int ui_getch | ( | ) |
Wait for a single input character from the NotCurses context.
ui is NULL. Definition at line 222 of file ui_notcurses_input.c.
References ui.
| int ui_mice_enable | ( | int | mask | ) |
Enable or disable mouse events for the NotCurses context.
Enable or disable mouse support.
| mask | The mouse event mask to enable. If 0, all mouse events are enabled. |
ui is NULL. Definition at line 310 of file ui_notcurses_input.c.
References ui.
| int ui_mousemask | ( | int | mask | ) |
Set the mouse event mask for the NotCurses context.
Enable or disable mouse support.
| mask | The mouse event mask to set. If 0, all mouse events are enabled. |
ui is NULL. Definition at line 297 of file ui_notcurses_input.c.
References ui.
Referenced by menu_cmd_processor(), and picker().
Determine which ncplane was clicked based on the mouse event coordinates.
| s | The UiSurface containing the planes. |
| w | The index of the plane to check for clicks. |
| ni | The NotCurses input event containing mouse coordinates. |
Definition at line 276 of file ui_notcurses_input.c.