Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2015-10-27 00:01:09 +00:00
commit 9c69a79f9a
4 changed files with 21 additions and 21 deletions

View File

@ -77,8 +77,6 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
continue; continue;
RB_FOREACH(bd, key_bindings, &table->key_bindings) { RB_FOREACH(bd, key_bindings, &table->key_bindings) {
key = key_string_lookup_key(bd->key); key = key_string_lookup_key(bd->key);
if (key == NULL)
continue;
if (bd->can_repeat) if (bd->can_repeat)
repeat = 1; repeat = 1;
@ -97,8 +95,6 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq)
continue; continue;
RB_FOREACH(bd, key_bindings, &table->key_bindings) { RB_FOREACH(bd, key_bindings, &table->key_bindings) {
key = key_string_lookup_key(bd->key); key = key_string_lookup_key(bd->key);
if (key == NULL)
continue;
if (!repeat) if (!repeat)
r = ""; r = "";
@ -140,8 +136,6 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq)
any_mode = 0; any_mode = 0;
RB_FOREACH(mbind, mode_key_tree, mtab->tree) { RB_FOREACH(mbind, mode_key_tree, mtab->tree) {
key = key_string_lookup_key(mbind->key); key = key_string_lookup_key(mbind->key);
if (key == NULL)
continue;
if (mbind->mode != 0) if (mbind->mode != 0)
any_mode = 1; any_mode = 1;
@ -153,8 +147,6 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq)
RB_FOREACH(mbind, mode_key_tree, mtab->tree) { RB_FOREACH(mbind, mode_key_tree, mtab->tree) {
key = key_string_lookup_key(mbind->key); key = key_string_lookup_key(mbind->key);
if (key == NULL)
continue;
mode = ""; mode = "";
if (mbind->mode != 0) if (mbind->mode != 0)

View File

@ -223,6 +223,8 @@ key_bindings_init(void)
"bind -n MouseDown1Pane select-pane -t=\\; send-keys -M", "bind -n MouseDown1Pane select-pane -t=\\; send-keys -M",
"bind -n MouseDrag1Border resize-pane -M", "bind -n MouseDrag1Border resize-pane -M",
"bind -n MouseDown1Status select-window -t=", "bind -n MouseDown1Status select-window -t=",
"bind -n WheelDownStatus next-window",
"bind -n WheelUpStatus previous-window",
"bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"' 'copy-mode -M'", "bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"' 'copy-mode -M'",
"bind -n MouseDown3Pane select-pane -mt=", "bind -n MouseDown3Pane select-pane -mt=",
"bind -n WheelUpPane if-shell -Ft= '#{mouse_any_flag}' 'send-keys -M' 'if -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"copy-mode -e\"'", "bind -n WheelUpPane if-shell -Ft= '#{mouse_any_flag}' 'send-keys -M' 'if -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"copy-mode -e\"'",

View File

@ -238,8 +238,10 @@ key_string_lookup_key(int key)
} }
/* Invalid keys are errors. */ /* Invalid keys are errors. */
if (key == 127 || key > 255) if (key == 127 || key > 255) {
return (NULL); snprintf(out, sizeof out, "<INVALID#%04x>", key);
return (out);
}
/* Check for standard or control key. */ /* Check for standard or control key. */
if (key >= 0 && key <= 32) { if (key >= 0 && key <= 32) {

View File

@ -550,7 +550,6 @@ server_client_handle_key(struct client *c, int key)
if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0) if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
return; return;
w = s->curw->window; w = s->curw->window;
wp = w->active;
/* Update the activity timer. */ /* Update the activity timer. */
if (gettimeofday(&c->activity_time, NULL) != 0) if (gettimeofday(&c->activity_time, NULL) != 0)
@ -591,19 +590,14 @@ server_client_handle_key(struct client *c, int key)
m->valid = 1; m->valid = 1;
m->key = key; m->key = key;
if (!options_get_number(&s->options, "mouse")) { if (!options_get_number(&s->options, "mouse"))
window_pane_key(wp, c, s, key, m); goto forward;
return;
}
} else } else
m->valid = 0; m->valid = 0;
/* Treat everything as a regular key when pasting is detected. */ /* Treat everything as a regular key when pasting is detected. */
if (!KEYC_IS_MOUSE(key) && server_client_assume_paste(s)) { if (!KEYC_IS_MOUSE(key) && server_client_assume_paste(s))
if (!(c->flags & CLIENT_READONLY)) goto forward;
window_pane_key(wp, c, s, key, m);
return;
}
retry: retry:
/* Try to see if there is a key binding in the current table. */ /* Try to see if there is a key binding in the current table. */
@ -679,7 +673,17 @@ retry:
key == options_get_number(&s->options, "prefix2")) { key == options_get_number(&s->options, "prefix2")) {
server_client_key_table(c, "prefix"); server_client_key_table(c, "prefix");
server_status_client(c); server_status_client(c);
} else if (!(c->flags & CLIENT_READONLY)) return;
}
forward:
if (c->flags & CLIENT_READONLY)
return;
if (KEYC_IS_MOUSE(key))
wp = cmd_mouse_pane(m, NULL, NULL);
else
wp = w->active;
if (wp != NULL)
window_pane_key(wp, c, s, key, m); window_pane_key(wp, c, s, key, m);
} }