fixed several page selection issues

This commit is contained in:
garbeam 2005-12-08 21:29:15 +02:00
parent e56d9dc8c1
commit bd66e70aba
2 changed files with 6 additions and 9 deletions

View File

@ -226,10 +226,8 @@ static int handle_kpress(XKeyEvent * e)
{ {
KeySym ksym = XKeycodeToKeysym(dpy, e->keycode, 0); KeySym ksym = XKeycodeToKeysym(dpy, e->keycode, 0);
if (ksym >= XK_1 && ksym <= XK_9) if (ksym >= XK_0 && ksym <= XK_9)
return ksym - XK_1; return ksym - XK_0;
else if (ksym == XK_0)
return 9;
else if (ksym >= XK_a && ksym <= XK_z) else if (ksym >= XK_a && ksym <= XK_z)
return 10 + ksym - XK_a; return 10 + ksym - XK_a;
@ -407,9 +405,9 @@ static void _select_page(void *obj, char *cmd)
if (!p || !cmd) if (!p || !cmd)
return; return;
if (!strncmp(cmd, "prev", 5)) if (!strncmp(cmd, "prev", 5))
p = cext_stack_get_up_item(&pages, p); p = cext_list_get_prev_item(&pages, p);
else if (!strncmp(cmd, "next", 5)) else if (!strncmp(cmd, "next", 5))
p = cext_stack_get_down_item(&pages, p); p = cext_list_get_next_item(&pages, p);
else else
p = cext_list_get_item(&pages, _strtonum(cmd, 0, cext_sizeof(&pages) - 1)); p = cext_list_get_item(&pages, _strtonum(cmd, 0, cext_sizeof(&pages) - 1));
sel_page(p); sel_page(p);
@ -426,7 +424,7 @@ static void new_page(void *obj, char *cmd)
{ {
Page *p = get_sel_page(); Page *p = get_sel_page();
if (p) if (p)
destroy_page(p); hide_page(p);
alloc_page(); alloc_page();
} }

View File

@ -167,8 +167,7 @@ kbind normal $MODKEY-S-$SOUTHKEY 'wmir write /wm/sel/a/sel/f/sel/ctl ''select ne
kbind normal $MODKEY-S-$NORTHKEY 'wmir write /wm/sel/a/sel/f/sel/ctl ''select prev''' kbind normal $MODKEY-S-$NORTHKEY 'wmir write /wm/sel/a/sel/f/sel/ctl ''select prev'''
kbind normal $MODKEY-space 'wmir write /wm/sel/ctl ''select toggled''' kbind normal $MODKEY-space 'wmir write /wm/sel/ctl ''select toggled'''
kbind normal $MODKEY-S-p 'wmir write /wm/ctl pager' kbind normal $MODKEY-S-p 'wmir write /wm/ctl pager'
kbind normal $MODKEY-S-0 'wmir write /wm/ctl ''select 10''' for(i in 0 1 2 3 4 5 6 7 8 9) {
for(i in 1 2 3 4 5 6 7 8 9) {
kbind normal $MODKEY-S-$i 'wmir write /wm/ctl ''select '^$i^'''' kbind normal $MODKEY-S-$i 'wmir write /wm/ctl ''select '^$i^''''
} }