summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-31 15:14:32 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-31 15:14:32 +0900
commit8e6c0c563ef0b24ccbd1a4131eb37fd4bf25ae30 (patch)
treee90d81cdac6bdbded2117f146e690ddff808a5b3
parent38d468fc612a1b2f3af01a182fd246f6b82b16a0 (diff)
use key not keyname so xmodmap works
-rw-r--r--src/bin/keyin.c12
-rw-r--r--src/bin/sel.c20
-rw-r--r--src/bin/termio.c58
3 files changed, 45 insertions, 45 deletions
diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index 3685628..a05eda9 100644
--- a/src/bin/keyin.c
+++ b/src/bin/keyin.c
@@ -201,12 +201,12 @@ _key_try(Termpty *ty, const Keyout *map, Evas_Event_Key_Down *ev)
201{ 201{
202 int i, inlen; 202 int i, inlen;
203 203
204 if (!ev->keyname) return EINA_FALSE; 204 if (!ev->key) return EINA_FALSE;
205 205
206 inlen = strlen(ev->keyname); 206 inlen = strlen(ev->key);
207 for (i = 0; map[i].in; i++) 207 for (i = 0; map[i].in; i++)
208 { 208 {
209 if ((inlen == map[i].inlen) && (!memcmp(ev->keyname, map[i].in, inlen))) 209 if ((inlen == map[i].inlen) && (!memcmp(ev->key, map[i].in, inlen)))
210 { 210 {
211 termpty_write(ty, map[i].out, map[i].outlen); 211 termpty_write(ty, map[i].out, map[i].outlen);
212 return EINA_TRUE; 212 return EINA_TRUE;
@@ -244,12 +244,12 @@ keyin_handle(Termpty *ty, Evas_Event_Key_Down *ev)
244 } 244 }
245 if (evas_key_modifier_is_set(ev->modifiers, "Control")) 245 if (evas_key_modifier_is_set(ev->modifiers, "Control"))
246 { 246 {
247 if (!strcmp(ev->keyname, "Minus")) 247 if (!strcmp(ev->key, "Minus"))
248 { 248 {
249 termpty_write(ty, "\037", 1); // generate US (unit separator) 249 termpty_write(ty, "\037", 1); // generate US (unit separator)
250 return; 250 return;
251 } 251 }
252 else if (!strcmp(ev->keyname, "space")) 252 else if (!strcmp(ev->key, "space"))
253 { 253 {
254 termpty_write(ty, "\0", 1); // generate 0 byte for ctrl+space 254 termpty_write(ty, "\0", 1); // generate 0 byte for ctrl+space
255 return; 255 return;
@@ -274,7 +274,7 @@ keyin_handle(Termpty *ty, Evas_Event_Key_Down *ev)
274 if (_key_try(ty, appcur_keyout, ev)) return; 274 if (_key_try(ty, appcur_keyout, ev)) return;
275 } 275 }
276 276
277 if ((ty->state.send_bs) && (!strcmp(ev->keyname, "BackSpace"))) 277 if ((ty->state.send_bs) && (!strcmp(ev->key, "BackSpace")))
278 { 278 {
279 termpty_write(ty, "\b", 1); 279 termpty_write(ty, "\b", 1);
280 return; 280 return;
diff --git a/src/bin/sel.c b/src/bin/sel.c
index 125c688..92e669e 100644
--- a/src/bin/sel.c
+++ b/src/bin/sel.c
@@ -177,8 +177,8 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
177 Eina_List *l; 177 Eina_List *l;
178 Entry *en; 178 Entry *en;
179 if (!sd) return; 179 if (!sd) return;
180 if ((!strcmp(ev->keyname, "Next")) || 180 if ((!strcmp(ev->key, "Next")) ||
181 (!strcmp(ev->keyname, "Right"))) 181 (!strcmp(ev->key, "Right")))
182 { 182 {
183 EINA_LIST_FOREACH(sd->items, l, en) 183 EINA_LIST_FOREACH(sd->items, l, en)
184 { 184 {
@@ -195,8 +195,8 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
195 sd->exit_now = EINA_FALSE; 195 sd->exit_now = EINA_FALSE;
196 _autozoom(data); 196 _autozoom(data);
197 } 197 }
198 else if ((!strcmp(ev->keyname, "Prior")) || 198 else if ((!strcmp(ev->key, "Prior")) ||
199 (!strcmp(ev->keyname, "Left"))) 199 (!strcmp(ev->key, "Left")))
200 { 200 {
201 EINA_LIST_FOREACH(sd->items, l, en) 201 EINA_LIST_FOREACH(sd->items, l, en)
202 { 202 {
@@ -213,7 +213,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
213 sd->exit_now = EINA_FALSE; 213 sd->exit_now = EINA_FALSE;
214 _autozoom(data); 214 _autozoom(data);
215 } 215 }
216 else if (!strcmp(ev->keyname, "Up")) 216 else if (!strcmp(ev->key, "Up"))
217 { 217 {
218 EINA_LIST_FOREACH(sd->items, l, en) 218 EINA_LIST_FOREACH(sd->items, l, en)
219 { 219 {
@@ -239,7 +239,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
239 sd->exit_now = EINA_FALSE; 239 sd->exit_now = EINA_FALSE;
240 _autozoom(data); 240 _autozoom(data);
241 } 241 }
242 else if (!strcmp(ev->keyname, "Down")) 242 else if (!strcmp(ev->key, "Down"))
243 { 243 {
244 EINA_LIST_FOREACH(sd->items, l, en) 244 EINA_LIST_FOREACH(sd->items, l, en)
245 { 245 {
@@ -265,9 +265,9 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
265 sd->exit_now = EINA_FALSE; 265 sd->exit_now = EINA_FALSE;
266 _autozoom(data); 266 _autozoom(data);
267 } 267 }
268 else if ((!strcmp(ev->keyname, "Return")) || 268 else if ((!strcmp(ev->key, "Return")) ||
269 (!strcmp(ev->keyname, "KP_Enter")) || 269 (!strcmp(ev->key, "KP_Enter")) ||
270 (!strcmp(ev->keyname, "space"))) 270 (!strcmp(ev->key, "space")))
271 { 271 {
272 sd->select_me = EINA_TRUE; 272 sd->select_me = EINA_TRUE;
273 sd->exit_me = EINA_FALSE; 273 sd->exit_me = EINA_FALSE;
@@ -279,7 +279,7 @@ _key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *
279 evas_object_smart_callback_call(data, "ending", NULL); 279 evas_object_smart_callback_call(data, "ending", NULL);
280 sel_zoom(data, 1.0); 280 sel_zoom(data, 1.0);
281 } 281 }
282 else if (!strcmp(ev->keyname, "Escape")) 282 else if (!strcmp(ev->key, "Escape"))
283 { 283 {
284 Evas_Object *entry = NULL; 284 Evas_Object *entry = NULL;
285 285
diff --git a/src/bin/termio.c b/src/bin/termio.c
index ee2f486..8f5dbb9 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1882,45 +1882,45 @@ _handle_alt_ctrl(const char *keyname, Evas_Object *term)
1882static Eina_Bool 1882static Eina_Bool
1883_handle_shift(Evas_Event_Key_Down *ev, int by, Evas_Object *term, Termio *sd) 1883_handle_shift(Evas_Event_Key_Down *ev, int by, Evas_Object *term, Termio *sd)
1884{ 1884{
1885 if (!strcmp(ev->keyname, "Prior")) 1885 if (!strcmp(ev->key, "Prior"))
1886 { 1886 {
1887 sd->scroll += by; 1887 sd->scroll += by;
1888 if (sd->scroll > sd->pty->backscroll_num) 1888 if (sd->scroll > sd->pty->backscroll_num)
1889 sd->scroll = sd->pty->backscroll_num; 1889 sd->scroll = sd->pty->backscroll_num;
1890 _smart_update_queue(term, sd); 1890 _smart_update_queue(term, sd);
1891 } 1891 }
1892 else if (!strcmp(ev->keyname, "Next")) 1892 else if (!strcmp(ev->key, "Next"))
1893 { 1893 {
1894 sd->scroll -= by; 1894 sd->scroll -= by;
1895 if (sd->scroll < 0) sd->scroll = 0; 1895 if (sd->scroll < 0) sd->scroll = 0;
1896 _smart_update_queue(term, sd); 1896 _smart_update_queue(term, sd);
1897 } 1897 }
1898 else if (!strcmp(ev->keyname, "Insert")) 1898 else if (!strcmp(ev->key, "Insert"))
1899 { 1899 {
1900 if (evas_key_modifier_is_set(ev->modifiers, "Control")) 1900 if (evas_key_modifier_is_set(ev->modifiers, "Control"))
1901 _paste_selection(term, ELM_SEL_TYPE_PRIMARY); 1901 _paste_selection(term, ELM_SEL_TYPE_PRIMARY);
1902 else 1902 else
1903 _paste_selection(term, ELM_SEL_TYPE_CLIPBOARD); 1903 _paste_selection(term, ELM_SEL_TYPE_CLIPBOARD);
1904 } 1904 }
1905 else if (!strcmp(ev->keyname, "KP_Add")) 1905 else if (!strcmp(ev->key, "KP_Add"))
1906 { 1906 {
1907 Config *config = termio_config_get(term); 1907 Config *config = termio_config_get(term);
1908 1908
1909 if (config) _font_size_set(term, config->font.size + 1); 1909 if (config) _font_size_set(term, config->font.size + 1);
1910 } 1910 }
1911 else if (!strcmp(ev->keyname, "KP_Subtract")) 1911 else if (!strcmp(ev->key, "KP_Subtract"))
1912 { 1912 {
1913 Config *config = termio_config_get(term); 1913 Config *config = termio_config_get(term);
1914 1914
1915 if (config) _font_size_set(term, config->font.size - 1); 1915 if (config) _font_size_set(term, config->font.size - 1);
1916 } 1916 }
1917 else if (!strcmp(ev->keyname, "KP_Multiply")) 1917 else if (!strcmp(ev->key, "KP_Multiply"))
1918 { 1918 {
1919 Config *config = termio_config_get(term); 1919 Config *config = termio_config_get(term);
1920 1920
1921 if (config) _font_size_set(term, 10); 1921 if (config) _font_size_set(term, 10);
1922 } 1922 }
1923 else if (!strcmp(ev->keyname, "KP_Divide")) 1923 else if (!strcmp(ev->key, "KP_Divide"))
1924 _take_selection(term, ELM_SEL_TYPE_CLIPBOARD); 1924 _take_selection(term, ELM_SEL_TYPE_CLIPBOARD);
1925 else 1925 else
1926 return EINA_FALSE; 1926 return EINA_FALSE;
@@ -1942,71 +1942,71 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
1942 (evas_key_modifier_is_set(ev->modifiers, "Control")) && 1942 (evas_key_modifier_is_set(ev->modifiers, "Control")) &&
1943 (!evas_key_modifier_is_set(ev->modifiers, "Shift"))) 1943 (!evas_key_modifier_is_set(ev->modifiers, "Shift")))
1944 { 1944 {
1945 if (!strcmp(ev->keyname, "Prior")) 1945 if (!strcmp(ev->key, "Prior"))
1946 { 1946 {
1947 evas_object_smart_callback_call(data, "prev", NULL); 1947 evas_object_smart_callback_call(data, "prev", NULL);
1948 goto end; 1948 goto end;
1949 } 1949 }
1950 else if (!strcmp(ev->keyname, "Next")) 1950 else if (!strcmp(ev->key, "Next"))
1951 { 1951 {
1952 evas_object_smart_callback_call(data, "next", NULL); 1952 evas_object_smart_callback_call(data, "next", NULL);
1953 goto end; 1953 goto end;
1954 } 1954 }
1955 else if (!strcmp(ev->keyname, "1")) 1955 else if (!strcmp(ev->key, "1"))
1956 { 1956 {
1957 _compose_seq_reset(sd); 1957 _compose_seq_reset(sd);
1958 evas_object_smart_callback_call(data, "tab,1", NULL); 1958 evas_object_smart_callback_call(data, "tab,1", NULL);
1959 goto end; 1959 goto end;
1960 } 1960 }
1961 else if (!strcmp(ev->keyname, "2")) 1961 else if (!strcmp(ev->key, "2"))
1962 { 1962 {
1963 _compose_seq_reset(sd); 1963 _compose_seq_reset(sd);
1964 evas_object_smart_callback_call(data, "tab,2", NULL); 1964 evas_object_smart_callback_call(data, "tab,2", NULL);
1965 goto end; 1965 goto end;
1966 } 1966 }
1967 else if (!strcmp(ev->keyname, "3")) 1967 else if (!strcmp(ev->key, "3"))
1968 { 1968 {
1969 _compose_seq_reset(sd); 1969 _compose_seq_reset(sd);
1970 evas_object_smart_callback_call(data, "tab,3", NULL); 1970 evas_object_smart_callback_call(data, "tab,3", NULL);
1971 goto end; 1971 goto end;
1972 } 1972 }
1973 else if (!strcmp(ev->keyname, "4")) 1973 else if (!strcmp(ev->key, "4"))
1974 { 1974 {
1975 _compose_seq_reset(sd); 1975 _compose_seq_reset(sd);
1976 evas_object_smart_callback_call(data, "tab,4", NULL); 1976 evas_object_smart_callback_call(data, "tab,4", NULL);
1977 goto end; 1977 goto end;
1978 } 1978 }
1979 else if (!strcmp(ev->keyname, "5")) 1979 else if (!strcmp(ev->key, "5"))
1980 { 1980 {
1981 _compose_seq_reset(sd); 1981 _compose_seq_reset(sd);
1982 evas_object_smart_callback_call(data, "tab,5", NULL); 1982 evas_object_smart_callback_call(data, "tab,5", NULL);
1983 goto end; 1983 goto end;
1984 } 1984 }
1985 else if (!strcmp(ev->keyname, "6")) 1985 else if (!strcmp(ev->key, "6"))
1986 { 1986 {
1987 _compose_seq_reset(sd); 1987 _compose_seq_reset(sd);
1988 evas_object_smart_callback_call(data, "tab,6", NULL); 1988 evas_object_smart_callback_call(data, "tab,6", NULL);
1989 goto end; 1989 goto end;
1990 } 1990 }
1991 else if (!strcmp(ev->keyname, "7")) 1991 else if (!strcmp(ev->key, "7"))
1992 { 1992 {
1993 _compose_seq_reset(sd); 1993 _compose_seq_reset(sd);
1994 evas_object_smart_callback_call(data, "tab,7", NULL); 1994 evas_object_smart_callback_call(data, "tab,7", NULL);
1995 goto end; 1995 goto end;
1996 } 1996 }
1997 else if (!strcmp(ev->keyname, "8")) 1997 else if (!strcmp(ev->key, "8"))
1998 { 1998 {
1999 _compose_seq_reset(sd); 1999 _compose_seq_reset(sd);
2000 evas_object_smart_callback_call(data, "tab,8", NULL); 2000 evas_object_smart_callback_call(data, "tab,8", NULL);
2001 goto end; 2001 goto end;
2002 } 2002 }
2003 else if (!strcmp(ev->keyname, "9")) 2003 else if (!strcmp(ev->key, "9"))
2004 { 2004 {
2005 _compose_seq_reset(sd); 2005 _compose_seq_reset(sd);
2006 evas_object_smart_callback_call(data, "tab,9", NULL); 2006 evas_object_smart_callback_call(data, "tab,9", NULL);
2007 goto end; 2007 goto end;
2008 } 2008 }
2009 else if (!strcmp(ev->keyname, "0")) 2009 else if (!strcmp(ev->key, "0"))
2010 { 2010 {
2011 _compose_seq_reset(sd); 2011 _compose_seq_reset(sd);
2012 evas_object_smart_callback_call(data, "tab,0", NULL); 2012 evas_object_smart_callback_call(data, "tab,0", NULL);
@@ -2017,37 +2017,37 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
2017 (evas_key_modifier_is_set(ev->modifiers, "Control")) && 2017 (evas_key_modifier_is_set(ev->modifiers, "Control")) &&
2018 (evas_key_modifier_is_set(ev->modifiers, "Shift"))) 2018 (evas_key_modifier_is_set(ev->modifiers, "Shift")))
2019 { 2019 {
2020 if (!strcmp(ev->keyname, "Prior")) 2020 if (!strcmp(ev->key, "Prior"))
2021 { 2021 {
2022 _compose_seq_reset(sd); 2022 _compose_seq_reset(sd);
2023 evas_object_smart_callback_call(data, "split,h", NULL); 2023 evas_object_smart_callback_call(data, "split,h", NULL);
2024 goto end; 2024 goto end;
2025 } 2025 }
2026 else if (!strcmp(ev->keyname, "Next")) 2026 else if (!strcmp(ev->key, "Next"))
2027 { 2027 {
2028 _compose_seq_reset(sd); 2028 _compose_seq_reset(sd);
2029 evas_object_smart_callback_call(data, "split,v", NULL); 2029 evas_object_smart_callback_call(data, "split,v", NULL);
2030 goto end; 2030 goto end;
2031 } 2031 }
2032 else if (!strcmp(ev->keyname, "t")) 2032 else if (!strcmp(ev->key, "t"))
2033 { 2033 {
2034 _compose_seq_reset(sd); 2034 _compose_seq_reset(sd);
2035 evas_object_smart_callback_call(data, "new", NULL); 2035 evas_object_smart_callback_call(data, "new", NULL);
2036 goto end; 2036 goto end;
2037 } 2037 }
2038 else if (!strcmp(ev->keyname, "Home")) 2038 else if (!strcmp(ev->key, "Home"))
2039 { 2039 {
2040 _compose_seq_reset(sd); 2040 _compose_seq_reset(sd);
2041 evas_object_smart_callback_call(data, "select", NULL); 2041 evas_object_smart_callback_call(data, "select", NULL);
2042 goto end; 2042 goto end;
2043 } 2043 }
2044 else if (!strcmp(ev->keyname, "c")) 2044 else if (!strcmp(ev->key, "c"))
2045 { 2045 {
2046 _compose_seq_reset(sd); 2046 _compose_seq_reset(sd);
2047 _take_selection(data, ELM_SEL_TYPE_CLIPBOARD); 2047 _take_selection(data, ELM_SEL_TYPE_CLIPBOARD);
2048 goto end; 2048 goto end;
2049 } 2049 }
2050 else if (!strcmp(ev->keyname, "v")) 2050 else if (!strcmp(ev->key, "v"))
2051 { 2051 {
2052 _compose_seq_reset(sd); 2052 _compose_seq_reset(sd);
2053 _paste_selection(data, ELM_SEL_TYPE_CLIPBOARD); 2053 _paste_selection(data, ELM_SEL_TYPE_CLIPBOARD);
@@ -2058,13 +2058,13 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
2058 (!evas_key_modifier_is_set(ev->modifiers, "Shift")) && 2058 (!evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
2059 (!evas_key_modifier_is_set(ev->modifiers, "Control"))) 2059 (!evas_key_modifier_is_set(ev->modifiers, "Control")))
2060 { 2060 {
2061 if (!strcmp(ev->keyname, "Home")) 2061 if (!strcmp(ev->key, "Home"))
2062 { 2062 {
2063 _compose_seq_reset(sd); 2063 _compose_seq_reset(sd);
2064 evas_object_smart_callback_call(data, "cmdbox", NULL); 2064 evas_object_smart_callback_call(data, "cmdbox", NULL);
2065 goto end; 2065 goto end;
2066 } 2066 }
2067 else if (!strcmp(ev->keyname, "Return")) 2067 else if (!strcmp(ev->key, "Return"))
2068 { 2068 {
2069 _compose_seq_reset(sd); 2069 _compose_seq_reset(sd);
2070 _paste_selection(data, ELM_SEL_TYPE_PRIMARY); 2070 _paste_selection(data, ELM_SEL_TYPE_PRIMARY);
@@ -2075,7 +2075,7 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
2075 (evas_key_modifier_is_set(ev->modifiers, "Control")) && 2075 (evas_key_modifier_is_set(ev->modifiers, "Control")) &&
2076 (!evas_key_modifier_is_set(ev->modifiers, "Shift"))) 2076 (!evas_key_modifier_is_set(ev->modifiers, "Shift")))
2077 { 2077 {
2078 if (_handle_alt_ctrl(ev->keyname, data)) 2078 if (_handle_alt_ctrl(ev->key, data))
2079 { 2079 {
2080 _compose_seq_reset(sd); 2080 _compose_seq_reset(sd);
2081 goto end; 2081 goto end;
@@ -2100,7 +2100,7 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
2100 } 2100 }
2101 } 2101 }
2102 if ((evas_key_modifier_is_set(ev->modifiers, "Shift")) && 2102 if ((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
2103 (ev->keyname)) 2103 (ev->key))
2104 { 2104 {
2105 int by = sd->grid.h - 2; 2105 int by = sd->grid.h - 2;
2106 2106