add keybinds to split terms.

SVN revision: 83358
devs/lucas/wip
Carsten Haitzler 10 years ago
parent f820185c7e
commit 85e60bbf74
  1. 7
      README
  2. 25
      src/bin/main.c
  3. 50
      src/bin/termio.c

@ -52,8 +52,11 @@ Shift+Keypad-Plus = Font size up 1
Shift+Keypad-Minus = Font size down 1
Shift+Keypad-Multiply = Reset font size to 10
Shift+Keypad-Divide = Copy highlight to Clipboard (same as ctrl+c in gui apps)
Ctrl+PgUp = reserved later for multi-terms
Ctrl+PgDn = reserved later for multi-terms
Ctrl+PgUp = switch focus to previous terminal inside a window
Ctrl+PgDn = switch focus to next terminal inside a window
Ctrl+t = create new terminal on top of current inside window (tabs) (not implemented)
Ctrl+Shift+PgUp = split terminal horizontally (1 term above the other)
Ctrl+Shift+PgDn = split terminal vertically (1 term to the left of the other)
Alt+Home = Enter command mode (enter commands to control terminology itself)
Command mode commands currently understood:

@ -857,6 +857,28 @@ _cb_next(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
if (term2) _term_focus(term2);
}
static void
_cb_new(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Term *term = data;
}
static void
_cb_split_h(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Term *term = data;
main_split_h(term->wn->win, term->term);
}
static void
_cb_split_v(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
Term *term = data;
main_split_v(term->wn->win, term->term);
}
static Eina_Bool
_cb_cmd_focus(void *data)
{
@ -1267,6 +1289,9 @@ main_term_new(Win *wn, Config *config, const char *cmd,
evas_object_smart_callback_add(o, "command", _cb_command, term);
evas_object_smart_callback_add(o, "prev", _cb_prev, term);
evas_object_smart_callback_add(o, "next", _cb_next, term);
evas_object_smart_callback_add(o, "new", _cb_new, term);
evas_object_smart_callback_add(o, "split,h", _cb_split_h, term);
evas_object_smart_callback_add(o, "split,v", _cb_split_v, term);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,

@ -978,6 +978,41 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
}
}
}
if ((!evas_key_modifier_is_set(ev->modifiers, "Alt")) &&
(evas_key_modifier_is_set(ev->modifiers, "Control")) &&
(!evas_key_modifier_is_set(ev->modifiers, "Shift")))
{
if (!strcmp(ev->keyname, "Prior"))
{
evas_object_smart_callback_call(data, "prev", NULL);
goto end;
}
else if (!strcmp(ev->keyname, "Next"))
{
evas_object_smart_callback_call(data, "next", NULL);
goto end;
}
else if (!strcmp(ev->keyname, "t"))
{
evas_object_smart_callback_call(data, "new", NULL);
goto end;
}
}
if ((!evas_key_modifier_is_set(ev->modifiers, "Alt")) &&
(evas_key_modifier_is_set(ev->modifiers, "Control")) &&
(evas_key_modifier_is_set(ev->modifiers, "Shift")))
{
if (!strcmp(ev->keyname, "Prior"))
{
evas_object_smart_callback_call(data, "split,h", NULL);
goto end;
}
else if (!strcmp(ev->keyname, "Next"))
{
evas_object_smart_callback_call(data, "split,v", NULL);
goto end;
}
}
if ((evas_key_modifier_is_set(ev->modifiers, "Alt")) &&
(!evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
(!evas_key_modifier_is_set(ev->modifiers, "Control")) &&
@ -1010,21 +1045,6 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
goto end;
}
}
if ((!evas_key_modifier_is_set(ev->modifiers, "Alt")) &&
(evas_key_modifier_is_set(ev->modifiers, "Control")) &&
(!evas_key_modifier_is_set(ev->modifiers, "Shift")))
{
if (!strcmp(ev->keyname, "Prior"))
{
evas_object_smart_callback_call(data, "prev", NULL);
goto end;
}
else if (!strcmp(ev->keyname, "Next"))
{
evas_object_smart_callback_call(data, "next", NULL);
goto end;
}
}
if (sd->jump_on_keypress)
{
if (!_is_modifier(ev->key))

Loading…
Cancel
Save