Pārlūkot izejas kodu

Merge pull request #14 from Malod219/master

Number key support
master
phillbush GitHub pirms 4 gadiem
vecāks
revīzija
736d20be06
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
2 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. +1
    -1
      xmenu.1
  2. +9
    -1
      xmenu.c

+ 1
- 1
xmenu.1 Parādīt failu

@@ -96,7 +96,7 @@ but can also be controlled by the keyboard.
Items can be selected using the arrow keys, Items can be selected using the arrow keys,
Tab (with and without Shift), Tab (with and without Shift),
Home, End, Home, End,
Enter and Esc. Enter and Esc, and 1-9 keys.
.TP .TP
.BR Home .BR Home
Select the first item in the menu. Select the first item in the menu.


+ 9
- 1
xmenu.c Parādīt failu

@@ -1280,8 +1280,16 @@ selectitem:
item = itemcycle(currmenu, ITEMPREV); item = itemcycle(currmenu, ITEMPREV);
} else if (ksym == XK_Tab || ksym == XK_Down || ksym == KSYMDOWN) { } else if (ksym == XK_Tab || ksym == XK_Down || ksym == KSYMDOWN) {
item = itemcycle(currmenu, ITEMNEXT); item = itemcycle(currmenu, ITEMNEXT);
} else if (ksym >= XK_1 && ksym <= XK_9){
item = itemcycle(currmenu, ITEMFIRST);
for(int i = ksym-XK_1; i > 0; i-=1){
currmenu->selected = item;
item = itemcycle(currmenu, ITEMNEXT);
if (item == itemcycle(currmenu, ITEMLAST))
break;
}
} else if ((ksym == XK_Return || ksym == XK_Right || ksym == KSYMRIGHT) && } else if ((ksym == XK_Return || ksym == XK_Right || ksym == KSYMRIGHT) &&
currmenu->selected != NULL) { currmenu->selected != NULL) {
item = currmenu->selected; item = currmenu->selected;
goto selectitem; goto selectitem;
} else if ((ksym == XK_Escape || ksym == XK_Left || ksym == KSYMLEFT) && } else if ((ksym == XK_Escape || ksym == XK_Left || ksym == KSYMLEFT) &&


||||||
x
 
000:0
Notiek ielāde…
Atcelt
Saglabāt