mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
Add keyboard shortcut to run application.
A common feature in several desktop environments is the ability to bring up a "run application" dialog via a keyboard shortcut (frequently Mod1+F2). This feature has been available to Window Maker users only through the root menu. This patch adds the ability for a user to set up a keyboard shortcut to accomplish this, either via WPrefs or by editing ~/GNUstep/Defaults/WindowMaker, e.g., with RunKey = "Mod1+F2"; Code from the execCommand function in rootmenu.c has been copied almost directly into the handleKeyPress function in misc.c to accomplish this.
This commit is contained in:
committed by
Carlos R. Mafra
parent
ab348c6dc8
commit
b764a766bf
19
src/event.c
19
src/event.c
@@ -1715,6 +1715,25 @@ static void handleKeyPress(XEvent * event)
|
||||
}
|
||||
break;
|
||||
|
||||
case WKBD_RUN:
|
||||
{
|
||||
char *cmdline;
|
||||
|
||||
cmdline = ExpandOptions(scr, _("exec %a(Run,Type command to run:)"));
|
||||
|
||||
XGrabPointer(dpy, scr->root_win, True, 0,
|
||||
GrabModeAsync, GrabModeAsync, None, wPreferences.cursor[WCUR_WAIT], CurrentTime);
|
||||
XSync(dpy, 0);
|
||||
|
||||
if (cmdline) {
|
||||
ExecuteShellCommand(scr, cmdline);
|
||||
wfree(cmdline);
|
||||
}
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
XSync(dpy, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case WKBD_NEXTWSLAYER:
|
||||
case WKBD_PREVWSLAYER:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user