ELinks 0.18.0
|
#include "intl/charsets.h"
Data Structures | |
struct | term_event_keyboard |
A key received from a terminal, with modifiers. More... | |
struct | interlink_event_keyboard |
Like struct term_event_keyboard but used in the interlink protocol between ELinks processes. More... |
Macros | |
#define | MAX_TERM_LEN 32 /* this must be multiple of 8! (alignment problems) */ |
#define | MAX_CWD_LEN 256 /* this must be multiple of 8! (alignment problems) */ |
#define | number_to_kbd_fkey(num) |
#define | kbd_fkey_to_number(key) |
#define | is_kbd_character(key) |
Check whether key is a character or a special key. | |
#define | kbd_get_key(kbd_) |
#define | kbd_key_is(kbd_, key) |
#define | kbd_get_modifier(kbd_) |
#define | kbd_modifier_is(kbd_, mod) |
#define | kbd_set(kbd_, key_, modifier_) |
Typedefs | |
typedef unicode_val_T | term_event_char_T |
A character received from a terminal. | |
typedef int32_t | term_event_key_T |
A key received from a terminal, without modifiers. | |
typedef unsigned char | term_event_modifier_T |
Enumerations | |
enum | term_event_modifier { KBD_MOD_NONE = 0 , KBD_MOD_SHIFT = 1 , KBD_MOD_CTRL = 2 , KBD_MOD_ALT = 4 , KBD_MOD_PASTE = 8 } |
Values for term_event_keyboard.modifier and interlink_event_keyboard.modifier. More... | |
enum | term_event_special_key { KBD_UNDEF = -1 , KBD_ENTER = -0x100 , KBD_BS = -0x101 , KBD_TAB = -0x102 , KBD_ESC = -0x103 , KBD_LEFT = -0x104 , KBD_RIGHT = -0x105 , KBD_UP = -0x106 , KBD_DOWN = -0x107 , KBD_INS = -0x108 , KBD_DEL = -0x109 , KBD_HOME = -0x10a , KBD_END = -0x10b , KBD_PAGE_UP = -0x10c , KBD_PAGE_DOWN = -0x10d , KBD_F1 = -0x120 , KBD_F2 = -0x121 , KBD_F3 = -0x122 , KBD_F4 = -0x123 , KBD_F5 = -0x124 , KBD_F6 = -0x125 , KBD_F7 = -0x126 , KBD_F8 = -0x127 , KBD_F9 = -0x128 , KBD_F10 = -0x129 , KBD_F11 = -0x12a , KBD_F12 = -0x12b , KBD_CTRL_C = -0x200 } |
Codes of special keys, for use in term_event_key_T. More... |
Functions | |
static int | is_kbd_fkey (term_event_key_T key) |
void | handle_trm (int std_in, int std_out, int sock_in, int sock_out, int ctl_in, void *init_string, int init_len, int remote) |
Construct the struct itrm of this process, make ditrm point to it, set up select() handlers, and send the initial interlink packet. | |
void | itrm_queue_event (struct itrm *itrm, char *data, int len) |
void | block_itrm (void) |
int | unblock_itrm (void) |
void | free_all_itrms (void) |
void | resize_terminal (void) |
void | dispatch_special (const char *) |
void | kbd_ctrl_c (void) |
int | is_blocked (void) |
void | get_terminal_name (char[MAX_TERM_LEN]) |
#define is_kbd_character | ( | key | ) |
Check whether key is a character or a special key.
Return true if key is a character from term_event_char_T. (The character is not necessarily printable.) Return false if key is a special key from enum term_event_special_key.
#define kbd_get_key | ( | kbd_ | ) |
#define kbd_get_modifier | ( | kbd_ | ) |
#define kbd_key_is | ( | kbd_, | |
key ) |
#define kbd_modifier_is | ( | kbd_, | |
mod ) |
#define kbd_set | ( | kbd_, | |
key_, | |||
modifier_ ) |
#define MAX_CWD_LEN 256 /* this must be multiple of 8! (alignment problems) */ |
#define MAX_TERM_LEN 32 /* this must be multiple of 8! (alignment problems) */ |
typedef unicode_val_T term_event_char_T |
A character received from a terminal.
typedef int32_t term_event_key_T |
A key received from a terminal, without modifiers.
The value is either from term_event_char_T or from enum term_event_special_key. To check which one it is, use is_kbd_character().
Any at least 32-bit signed integer type would work here; using an exact-width type hurts portability in principle, but some other parts of ELinks already require the existence of uint32_t.
typedef unsigned char term_event_modifier_T |
enum term_event_modifier |
Values for term_event_keyboard.modifier and interlink_event_keyboard.modifier.
Enumerator | |
---|---|
KBD_MOD_NONE | |
KBD_MOD_SHIFT | |
KBD_MOD_CTRL | |
KBD_MOD_ALT | |
KBD_MOD_PASTE | The character is part of a string being pasted from the terminal. parse_keystroke() does not support this flag, so keystrokes that include it cannot be bound to any actions, and ELinks will instead insert the characters if possible. |
Codes of special keys, for use in term_event_key_T.
The enum has a tag mainly to let you cast numbers to it in GDB and see their names. ELinks doesn't use this enum type as term_event_key_T, because it might be 16-bit and Unicode characters wouldn't then fit.
void block_itrm | ( | void | ) |
void dispatch_special | ( | const char * | text | ) |
void free_all_itrms | ( | void | ) |
void get_terminal_name | ( | char | name[MAX_TERM_LEN] | ) |
void handle_trm | ( | int | std_in, |
int | std_out, | ||
int | sock_in, | ||
int | sock_out, | ||
int | ctl_in, | ||
void * | init_string, | ||
int | init_len, | ||
int | remote ) |
Construct the struct itrm of this process, make ditrm point to it, set up select() handlers, and send the initial interlink packet.
The first five parameters are file descriptors that this function saves in submembers of struct itrm, and for which this function may set select() handlers. Please see the definitions of struct itrm_in and struct itrm_out for further explanations.
std_in | itrm_in.std: read tty device (or pipe) |
std_out | itrm_out.std: write tty device (or pipe) |
sock_in | itrm_in.sock
|
sock_out | itrm_out.sock
|
ctl_in | itrm_in.ctl: control tty device |
The remaining three parameters control the initial interlink packet.
init_string | A string to be passed to the master process. Need not be null-terminated. If remote == 0, this is a URI. Otherwise, this is a remote command. |
init_len | The length of init_string, in bytes. |
remote | = 0 if asking the master to start a new session and display it via this process. Otherwise, enum remote_session_flags. |
int is_blocked | ( | void | ) |
|
inlinestatic |
void itrm_queue_event | ( | struct itrm * | itrm, |
char * | data, | ||
int | len ) |
void kbd_ctrl_c | ( | void | ) |
void resize_terminal | ( | void | ) |
int unblock_itrm | ( | void | ) |