summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-07-28 00:22:08 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-07-28 00:22:08 +0000
commit2f980684bd58f764fa1f3c136a67d6ef094de0f4 (patch)
treef8444d0c42e307b4145b3c42d9ac7467e96e4ce0 /src
parent6f3f7c10f9184a88ef0535390e827fb69c4cf2ca (diff)
make on key press jump actually just filter known lock/modifiers.
there's enough strcmps anyway. it isi JUSt a strcmp on a keypress... SVN revision: 74514
Diffstat (limited to 'src')
-rw-r--r--src/bin/termio.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 48a0ce8..c5d4d80 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -806,6 +806,22 @@ _smart_cb_key_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, vo
806 } 806 }
807} 807}
808 808
809static Eina_Bool
810_is_modifier(const char *key)
811{
812 if ((!strncmp(key, "Shift", 5)) ||
813 (!strncmp(key, "Control", 7)) ||
814 (!strncmp(key, "Alt", 3)) ||
815 (!strncmp(key, "Meta", 4)) ||
816 (!strncmp(key, "Super", 5)) ||
817 (!strncmp(key, "Hyper", 5)) ||
818 (!strcmp(key, "Scroll_Lock")) ||
819 (!strcmp(key, "Num_Lock")) ||
820 (!strcmp(key, "Caps_Lock")))
821 return EINA_TRUE;
822 return EINA_FALSE;
823}
824
809void 825void
810_smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event) 826_smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
811{ 827{
@@ -905,10 +921,13 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
905 } 921 }
906 } 922 }
907 } 923 }
908 if (sd->jump_on_keypress && ev->string && (ev->string[0] != 0)) 924 if (sd->jump_on_keypress)
909 { 925 {
910 sd->scroll = 0; 926 if (!_is_modifier(ev->key))
911 _smart_update_queue(data, sd); 927 {
928 sd->scroll = 0;
929 _smart_update_queue(data, sd);
930 }
912 } 931 }
913 // if term app asked fro kbd lock - dont handle here 932 // if term app asked fro kbd lock - dont handle here
914 if (sd->pty->state.kbd_lock) return; 933 if (sd->pty->state.kbd_lock) return;
@@ -931,9 +950,7 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
931 } 950 }
932 else 951 else
933 { 952 {
934 if (!strncmp(ev->key, "Shift", 5)) goto end; 953 if (_is_modifier(ev->key)) goto end;
935 if (!strncmp(ev->key, "Control", 7)) goto end;
936 if (!strncmp(ev->key, "Alt", 3)) goto end;
937 sd->seq = eina_list_append(sd->seq, eina_stringshare_add(ev->key)); 954 sd->seq = eina_list_append(sd->seq, eina_stringshare_add(ev->key));
938 state = ecore_compose_get(sd->seq, &compres); 955 state = ecore_compose_get(sd->seq, &compres);
939 if (state == ECORE_COMPOSE_NONE) 956 if (state == ECORE_COMPOSE_NONE)