mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-21 10:53:31 +01:00
wmaker: add keyboard control to crash window
This patch is allowing to control the wpopupbutton entries via keyboard up/down arrows. It happens to me a few weeks ago during development, wmaker crashed and I lost the mouse control. I was stuck on that dialog box without a way to select another entry.
This commit is contained in:
committed by
Carlos R. Mafra
parent
156841f80e
commit
7778df2fc5
15
src/dialog.c
15
src/dialog.c
@@ -1641,6 +1641,8 @@ typedef struct _CrashPanel {
|
|||||||
int action; /* what to do after */
|
int action; /* what to do after */
|
||||||
|
|
||||||
KeyCode retKey;
|
KeyCode retKey;
|
||||||
|
KeyCode upKey;
|
||||||
|
KeyCode downKey;
|
||||||
|
|
||||||
} CrashPanel;
|
} CrashPanel;
|
||||||
|
|
||||||
@@ -1650,6 +1652,17 @@ static void handleKeyPress(XEvent * event, void *clientData)
|
|||||||
|
|
||||||
if (event->xkey.keycode == panel->retKey) {
|
if (event->xkey.keycode == panel->retKey) {
|
||||||
WMPerformButtonClick(panel->okB);
|
WMPerformButtonClick(panel->okB);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event->xkey.keycode == panel->upKey) {
|
||||||
|
WMSelectPopUpButtonPreviousItem(panel->whatP);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event->xkey.keycode == panel->downKey) {
|
||||||
|
WMSelectPopUpButtonNextItem(panel->whatP);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1721,6 +1734,8 @@ int wShowCrashingDialogPanel(int whatSig)
|
|||||||
panel = wmalloc(sizeof(CrashPanel));
|
panel = wmalloc(sizeof(CrashPanel));
|
||||||
|
|
||||||
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
|
panel->retKey = XKeysymToKeycode(dpy, XK_Return);
|
||||||
|
panel->upKey = XKeysymToKeycode(dpy, XK_Up);
|
||||||
|
panel->downKey = XKeysymToKeycode(dpy, XK_Down);
|
||||||
|
|
||||||
panel->win = WMCreateWindow(scr, "crashingDialog");
|
panel->win = WMCreateWindow(scr, "crashingDialog");
|
||||||
WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
|
WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
|
||||||
|
|||||||
Reference in New Issue
Block a user