This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
[PATCH 2/3] Cygwin/X: Generate X keycodes for a few 'internet' keys
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-xfree at cygwin dot com
- Cc: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- Date: Sun, 18 Apr 2010 22:13:54 +0100
- Subject: [PATCH 2/3] Cygwin/X: Generate X keycodes for a few 'internet' keys
- References: <4BCB752B.3010307@dronecode.org.uk>
- Reply-to: cygwin-xfree at cygwin dot com
Add a few more special keys I have on my keyboard: mail, search, browser
These are normally trapped by Windows, so -keyhook needs to be taught
how to catch them as well
---
hw/xwin/winkeybd.h | 6 +++---
hw/xwin/winkeyhook.c | 12 +++++++-----
hw/xwin/winkeynames.h | 4 ++++
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index 662392b..2784673 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -213,9 +213,9 @@ g_iKeyMap [] = {
/* 167 */ 0, 0, 0,
/* 168 */ 0, 0, 0,
/* 169 */ 0, 0, 0,
- /* 170 */ 0, 0, 0,
+ /* 170 */ VK_BROWSER_SEARCH,KEY_SEARCH, 0,
/* 171 */ 0, 0, 0,
- /* 172 */ 0, 0, 0,
+ /* 172 */ VK_BROWSER_HOME,KEY_BROWSER, 0,
/* 173 */ VK_VOLUME_MUTE, 0, KEY_Mute,
/* 174 */ VK_VOLUME_DOWN, 0, KEY_AudioLower,
/* 175 */ VK_VOLUME_UP, 0, KEY_AudioRaise,
@@ -223,7 +223,7 @@ g_iKeyMap [] = {
/* 177 */ VK_MEDIA_PREV_TRACK, 0, KEY_PREVIOUSSONG,
/* 178 */ VK_MEDIA_STOP, 0, KEY_STOPCD,
/* 179 */ VK_MEDIA_PLAY_PAUSE, 0, KEY_PLAYPAUSE,
- /* 180 */ 0, 0, 0,
+ /* 180 */ VK_LAUNCH_MAIL, KEY_MAIL, 0,
/* 181 */ 0, 0, 0,
/* 182 */ 0, 0, 0,
/* 183 */ 0, 0, 0,
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index 2d6ed18..0c2e65b 100755
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -101,11 +101,13 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
switch (wParam)
{
case WM_KEYDOWN: case WM_SYSKEYDOWN:
- case WM_KEYUP: case WM_SYSKEYUP:
- fPassKeystroke =
- (fPassAltTab &&
- (p->vkCode == VK_TAB) && ((p->flags & LLKHF_ALTDOWN) != 0))
- || (p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN)
+ case WM_KEYUP: case WM_SYSKEYUP:
+ fPassKeystroke =
+ (fPassAltTab &&
+ (p->vkCode == VK_TAB) && ((p->flags & LLKHF_ALTDOWN) != 0))
+ || (p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN)
+ || (p->vkCode == VK_BROWSER_SEARCH) || (p->vkCode == VK_BROWSER_HOME)
+ || (p->vkCode == VK_LAUNCH_MAIL)
;
break;
}
diff --git a/hw/xwin/winkeynames.h b/hw/xwin/winkeynames.h
index 5a3129f..2f45ce6 100644
--- a/hw/xwin/winkeynames.h
+++ b/hw/xwin/winkeynames.h
@@ -200,6 +200,10 @@
#define KEY_PREVIOUSSONG /* Media previous */ 136
#define KEY_STOPCD /* Media stop */ 156
+#define KEY_SEARCH /* Search */ 221
+#define KEY_MAIL /* Mail */ 228
+#define KEY_BROWSER /* Browser */ 170
+
/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
--
1.7.0.4
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/