[Thread Prev][Thread Next]   >Date Index >Thread Index

[wmx] Quick Keys for Keyboard Menu

Sven Oliver Moll - Fri Feb 05 16:03:52 1999

Hello, folks!

I just added quickkey (for Sun Keyboards) support to Lasse Rasinen's
<lrasinen@iki.fi> Keyboard Menu Code. Works fine on my system here.

Here's the patch:

--- wmx-5sec3lr2/Config.h	Wed Feb  3 21:15:30 1999
+++ wmx-5sec3lr3/Config.h	Fri Feb  5 15:31:53 1999
@@ -226,7 +226,8 @@
 #define CONFIG_QUICKHIDE_KEY	XK_F17
 #define CONFIG_QUICKHEIGHT_KEY	XK_F13
 #define CONFIG_QUICKRAISE_ALSO_LOWERS True 
-
+#define CONFIG_QUICKCLIENT_MENU_KEY  XK_F12
+#define CONFIG_QUICKCOMMAND_MENU_KEY XK_F14
 
 // ==============================
 // Section III. Colours and fonts
--- wmx-5sec3lr2/Client.C	Tue Feb  2 01:25:47 1999
+++ wmx-5sec3lr3/Client.C	Fri Feb  5 15:35:52 1999
@@ -203,6 +203,18 @@
 		     GrabModeAsync, GrabModeAsync);
 	}
 
+	keycode = XKeysymToKeycode(display(), CONFIG_QUICKCLIENT_MENU_KEY);
+	if (keycode) {
+	    XGrabKey(display(), keycode, 0, m_window, True,
+		     GrabModeAsync, GrabModeAsync);
+	}
+
+	keycode = XKeysymToKeycode(display(), CONFIG_QUICKCOMMAND_MENU_KEY);
+	if (keycode) {
+	    XGrabKey(display(), keycode, 0, m_window, True,
+		     GrabModeAsync, GrabModeAsync);
+	}
+
 	if (CONFIG_USE_CHANNEL_KEYS) {
 	    for (i = 0; i < 12; ++i) {
 		keycode = XKeysymToKeycode(display(), XK_F1 + i);
--- wmx-5sec3lr2/Buttons.C	Tue Feb  2 01:25:05 1999
+++ wmx-5sec3lr3/Buttons.C	Fri Feb  5 15:44:45 1999
@@ -118,6 +118,14 @@
 		c->fullHeight();
 	    }
 
+	} else if ((key == CONFIG_QUICKCLIENT_MENU_KEY && c)
+		   && CONFIG_WANT_KEYBOARD_MENU) {
+	    ClientMenu menu(this, (XEvent *)ev);
+
+	} else if ((key == CONFIG_QUICKCOMMAND_MENU_KEY && c)
+		   && CONFIG_WANT_KEYBOARD_MENU) {
+	    CommandMenu menu(this, (XEvent *)ev);
+	    
 	} else if (ev->state & CONFIG_ALT_KEY_MASK) {
 
 	    if (key >= XK_F1 && key <= XK_F12 &&


By the way: I'm not so good at the menu code, but how about moving [Exit wmx]
from the client menu to the command menu? It makes more sense there, imho.

Greetings from Germany,
SvOlli
-- 
  _______
 (  /\           | 
__)v\/lli a.k.a. | It's getting harder, just keeping life and soul together ...
Sven Oliver Moll |   -- Nik Kershaw, "Wouldn't It Be Good ?"




Next: