Functions and constants for polling and interpreting user input.
More...
|
#define | retroflat_buffer_bksp(buffer, buffer_cur, buffer_sz) |
| Remove a character from a text buffer before cursor position.
|
|
#define | retroflat_buffer_insert(c, buffer, buffer_cur, buffer_sz, buffer_mx) |
| Insert a character into a text buffer at cursor position.
|
|
#define | RETROFLAT_INPUT_MOD_SHIFT 0x01 |
|
#define | RETROFLAT_INPUT_MOD_ALT 0x02 |
|
#define | RETROFLAT_INPUT_MOD_CTRL 0x04 |
|
#define | RETROFLAT_INPUT_FORCE_UPPER 0x08 |
|
Functions and constants for polling and interpreting user input.
◆ retroflat_buffer_bksp
#define retroflat_buffer_bksp |
( |
| buffer, |
|
|
| buffer_cur, |
|
|
| buffer_sz ) |
Value: if( 0 < buffer_cur ) { \
if( buffer_cur < buffer_sz ) { \
memmove( \
&(buffer[(buffer_cur) - 1]), \
&(buffer[buffer_cur]), \
(buffer_sz) - (buffer_cur) ); \
} \
buffer_cur--; \
buffer_sz--; \
buffer[buffer_sz] = '\0'; \
}
Remove a character from a text buffer before cursor position.
◆ retroflat_buffer_insert
#define retroflat_buffer_insert |
( |
| c, |
|
|
| buffer, |
|
|
| buffer_cur, |
|
|
| buffer_sz, |
|
|
| buffer_mx ) |
Value: if( buffer_sz + 1 < buffer_mx ) { \
if( buffer_cur < buffer_sz ) { \
memmove( \
&(buffer[(buffer_cur) + 1]), \
&(buffer[buffer_cur]), \
(buffer_sz) - (buffer_cur) ); \
} \
buffer[buffer_cur] = c; \
buffer_cur++; \
buffer_sz++; \
buffer[buffer_sz] = '\0'; \
}
Insert a character into a text buffer at cursor position.
◆ retroflat_poll_input()