mirror of
https://github.com/0intro/wmii
synced 2024-11-22 13:52:17 +03:00
fixed several page selection issues
This commit is contained in:
parent
e56d9dc8c1
commit
bd66e70aba
12
cmd/wm/wm.c
12
cmd/wm/wm.c
@ -226,10 +226,8 @@ static int handle_kpress(XKeyEvent * e)
|
||||
{
|
||||
KeySym ksym = XKeycodeToKeysym(dpy, e->keycode, 0);
|
||||
|
||||
if (ksym >= XK_1 && ksym <= XK_9)
|
||||
return ksym - XK_1;
|
||||
else if (ksym == XK_0)
|
||||
return 9;
|
||||
if (ksym >= XK_0 && ksym <= XK_9)
|
||||
return ksym - XK_0;
|
||||
else if (ksym >= XK_a && ksym <= XK_z)
|
||||
return 10 + ksym - XK_a;
|
||||
|
||||
@ -407,9 +405,9 @@ static void _select_page(void *obj, char *cmd)
|
||||
if (!p || !cmd)
|
||||
return;
|
||||
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))
|
||||
p = cext_stack_get_down_item(&pages, p);
|
||||
p = cext_list_get_next_item(&pages, p);
|
||||
else
|
||||
p = cext_list_get_item(&pages, _strtonum(cmd, 0, cext_sizeof(&pages) - 1));
|
||||
sel_page(p);
|
||||
@ -426,7 +424,7 @@ static void new_page(void *obj, char *cmd)
|
||||
{
|
||||
Page *p = get_sel_page();
|
||||
if (p)
|
||||
destroy_page(p);
|
||||
hide_page(p);
|
||||
alloc_page();
|
||||
}
|
||||
|
||||
|
3
rc/wmirc
3
rc/wmirc
@ -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-space 'wmir write /wm/sel/ctl ''select toggled'''
|
||||
kbind normal $MODKEY-S-p 'wmir write /wm/ctl pager'
|
||||
kbind normal $MODKEY-S-0 'wmir write /wm/ctl ''select 10'''
|
||||
for(i in 1 2 3 4 5 6 7 8 9) {
|
||||
for(i in 0 1 2 3 4 5 6 7 8 9) {
|
||||
kbind normal $MODKEY-S-$i 'wmir write /wm/ctl ''select '^$i^''''
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user