version 1.570, 2015/10/31 13:12:03 |
version 1.571, 2015/11/12 11:05:34 |
|
|
#define BELL_OTHER 3 |
#define BELL_OTHER 3 |
|
|
/* Special key codes. */ |
/* Special key codes. */ |
#define KEYC_NONE 0xfff |
#define KEYC_NONE 0xffff00000000ULL |
#define KEYC_BASE 0x1000 |
#define KEYC_BASE 0x100000000000ULL |
|
|
/* Key modifier bits. */ |
/* Key modifier bits. */ |
#define KEYC_ESCAPE 0x2000 |
#define KEYC_ESCAPE 0x200000000000ULL |
#define KEYC_CTRL 0x4000 |
#define KEYC_CTRL 0x400000000000ULL |
#define KEYC_SHIFT 0x8000 |
#define KEYC_SHIFT 0x800000000000ULL |
|
|
/* Mask to obtain key w/o modifiers. */ |
/* Mask to obtain key w/o modifiers. */ |
#define KEYC_MASK_MOD (KEYC_ESCAPE|KEYC_CTRL|KEYC_SHIFT) |
#define KEYC_MASK_MOD (KEYC_ESCAPE|KEYC_CTRL|KEYC_SHIFT) |
|
|
{ #s "Status", KEYC_ ## name ## _STATUS }, \ |
{ #s "Status", KEYC_ ## name ## _STATUS }, \ |
{ #s "Border", KEYC_ ## name ## _BORDER } |
{ #s "Border", KEYC_ ## name ## _BORDER } |
|
|
|
/* |
|
* A single key. This can be ASCII or Unicode or one of the keys starting at |
|
* KEYC_BASE. |
|
*/ |
|
typedef uint64_t key_code; |
|
|
/* Special key codes. */ |
/* Special key codes. */ |
enum key_code { |
enum { |
/* Focus events. */ |
/* Focus events. */ |
KEYC_FOCUS_IN = KEYC_BASE, |
KEYC_FOCUS_IN = KEYC_BASE, |
KEYC_FOCUS_OUT, |
KEYC_FOCUS_OUT, |
|
|
|
|
/* Binding between a key and a command. */ |
/* Binding between a key and a command. */ |
struct mode_key_binding { |
struct mode_key_binding { |
int key; |
key_code key; |
|
|
int mode; |
int mode; |
enum mode_key_cmd cmd; |
enum mode_key_cmd cmd; |
|
|
void (*free)(struct window_pane *); |
void (*free)(struct window_pane *); |
void (*resize)(struct window_pane *, u_int, u_int); |
void (*resize)(struct window_pane *, u_int, u_int); |
void (*key)(struct window_pane *, struct client *, struct session *, |
void (*key)(struct window_pane *, struct client *, struct session *, |
int, struct mouse_event *); |
key_code, struct mouse_event *); |
}; |
}; |
|
|
/* Structures for choose mode. */ |
/* Structures for choose mode. */ |
|
|
|
|
/* Mouse input. */ |
/* Mouse input. */ |
struct mouse_event { |
struct mouse_event { |
int valid; |
int valid; |
|
|
int key; |
key_code key; |
int statusat; |
int statusat; |
|
|
u_int x; |
u_int x; |
u_int y; |
u_int y; |
u_int b; |
u_int b; |
|
|
u_int lx; |
u_int lx; |
u_int ly; |
u_int ly; |
u_int lb; |
u_int lb; |
|
|
int s; |
int s; |
int w; |
int w; |
int wp; |
int wp; |
|
|
u_int sgr_type; |
u_int sgr_type; |
u_int sgr_b; |
u_int sgr_b; |
}; |
}; |
|
|
/* TTY information. */ |
/* TTY information. */ |
struct tty_key { |
struct tty_key { |
char ch; |
char ch; |
int key; |
key_code key; |
|
|
struct tty_key *left; |
struct tty_key *left; |
struct tty_key *right; |
struct tty_key *right; |
|
|
|
|
/* Key binding and key table. */ |
/* Key binding and key table. */ |
struct key_binding { |
struct key_binding { |
int key; |
key_code key; |
struct cmd_list *cmdlist; |
struct cmd_list *cmdlist; |
int can_repeat; |
int can_repeat; |
|
|
|
|
const struct mode_key_table *mode_key_findtable(const char *); |
const struct mode_key_table *mode_key_findtable(const char *); |
void mode_key_init_trees(void); |
void mode_key_init_trees(void); |
void mode_key_init(struct mode_key_data *, struct mode_key_tree *); |
void mode_key_init(struct mode_key_data *, struct mode_key_tree *); |
enum mode_key_cmd mode_key_lookup(struct mode_key_data *, int, const char **); |
enum mode_key_cmd mode_key_lookup(struct mode_key_data *, key_code, |
|
const char **); |
|
|
/* notify.c */ |
/* notify.c */ |
void notify_enable(void); |
void notify_enable(void); |
|
|
const char *tty_acs_get(struct tty *, u_char); |
const char *tty_acs_get(struct tty *, u_char); |
|
|
/* tty-keys.c */ |
/* tty-keys.c */ |
void tty_keys_build(struct tty *); |
void tty_keys_build(struct tty *); |
void tty_keys_free(struct tty *); |
void tty_keys_free(struct tty *); |
int tty_keys_next(struct tty *); |
key_code tty_keys_next(struct tty *); |
|
|
/* arguments.c */ |
/* arguments.c */ |
int args_cmp(struct args_entry *, struct args_entry *); |
int args_cmp(struct args_entry *, struct args_entry *); |
|
|
int key_bindings_cmp(struct key_binding *, struct key_binding *); |
int key_bindings_cmp(struct key_binding *, struct key_binding *); |
struct key_table *key_bindings_get_table(const char *, int); |
struct key_table *key_bindings_get_table(const char *, int); |
void key_bindings_unref_table(struct key_table *); |
void key_bindings_unref_table(struct key_table *); |
void key_bindings_add(const char *, int, int, struct cmd_list *); |
void key_bindings_add(const char *, key_code, int, struct cmd_list *); |
void key_bindings_remove(const char *, int); |
void key_bindings_remove(const char *, key_code); |
void key_bindings_remove_table(const char *); |
void key_bindings_remove_table(const char *); |
void key_bindings_init(void); |
void key_bindings_init(void); |
void key_bindings_dispatch(struct key_binding *, struct client *, |
void key_bindings_dispatch(struct key_binding *, struct client *, |
struct mouse_event *); |
struct mouse_event *); |
|
|
/* key-string.c */ |
/* key-string.c */ |
int key_string_lookup_string(const char *); |
key_code key_string_lookup_string(const char *); |
const char *key_string_lookup_key(int); |
const char *key_string_lookup_key(key_code); |
|
|
/* alerts.c */ |
/* alerts.c */ |
void alerts_reset_all(void); |
void alerts_reset_all(void); |
|
|
|
|
/* server-client.c */ |
/* server-client.c */ |
int server_client_check_nested(struct client *); |
int server_client_check_nested(struct client *); |
void server_client_handle_key(struct client *, int); |
void server_client_handle_key(struct client *, key_code); |
void server_client_create(int); |
void server_client_create(int); |
int server_client_open(struct client *, char **); |
int server_client_open(struct client *, char **); |
void server_client_unref(struct client *); |
void server_client_unref(struct client *); |
|
|
int (*)(void *, const char *), void (*)(void *), void *, int); |
int (*)(void *, const char *), void (*)(void *), void *, int); |
void status_prompt_clear(struct client *); |
void status_prompt_clear(struct client *); |
int status_prompt_redraw(struct client *); |
int status_prompt_redraw(struct client *); |
void status_prompt_key(struct client *, int); |
void status_prompt_key(struct client *, key_code); |
void status_prompt_update(struct client *, const char *, const char *); |
void status_prompt_update(struct client *, const char *, const char *); |
void status_prompt_load_history(void); |
void status_prompt_load_history(void); |
void status_prompt_save_history(void); |
void status_prompt_save_history(void); |
|
|
void input_parse(struct window_pane *); |
void input_parse(struct window_pane *); |
|
|
/* input-key.c */ |
/* input-key.c */ |
void input_key(struct window_pane *, int, struct mouse_event *); |
void input_key(struct window_pane *, key_code, struct mouse_event *); |
|
|
/* xterm-keys.c */ |
/* xterm-keys.c */ |
char *xterm_keys_lookup(int); |
char *xterm_keys_lookup(key_code); |
int xterm_keys_find(const char *, size_t, size_t *, int *); |
int xterm_keys_find(const char *, size_t, size_t *, key_code *); |
|
|
/* colour.c */ |
/* colour.c */ |
int colour_find_rgb(u_char, u_char, u_char); |
int colour_find_rgb(u_char, u_char, u_char); |
|
|
struct window_pane *, const struct window_mode *); |
struct window_pane *, const struct window_mode *); |
void window_pane_reset_mode(struct window_pane *); |
void window_pane_reset_mode(struct window_pane *); |
void window_pane_key(struct window_pane *, struct client *, |
void window_pane_key(struct window_pane *, struct client *, |
struct session *, int, struct mouse_event *); |
struct session *, key_code, struct mouse_event *); |
int window_pane_visible(struct window_pane *); |
int window_pane_visible(struct window_pane *); |
char *window_pane_search( |
char *window_pane_search( |
struct window_pane *, const char *, u_int *); |
struct window_pane *, const char *, u_int *); |
|
|
int utf8_open(struct utf8_data *, u_char); |
int utf8_open(struct utf8_data *, u_char); |
int utf8_append(struct utf8_data *, u_char); |
int utf8_append(struct utf8_data *, u_char); |
u_int utf8_combine(const struct utf8_data *); |
u_int utf8_combine(const struct utf8_data *); |
|
int utf8_split(u_int, struct utf8_data *); |
u_int utf8_split2(u_int, u_char *); |
u_int utf8_split2(u_int, u_char *); |
int utf8_strvis(char *, const char *, size_t, int); |
int utf8_strvis(char *, const char *, size_t, int); |
struct utf8_data *utf8_fromcstr(const char *); |
struct utf8_data *utf8_fromcstr(const char *); |