summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-18 11:59:25 -0800
committerKeith Packard <keithp@keithp.com>2011-02-18 11:59:25 -0800
commitd1123b66ebbcf96dd816236f54befc568a5f7c68 (patch)
treeebd4b43a83a103c5e65b8b132d934be355344b71
parent5d020c31351594c104fb46615ce41f256cd8e8b9 (diff)
parentf6e4ace9eabea1bb2a06dd86b6ffb954917a74ce (diff)
Merge remote branch 'jturney/master'
-rw-r--r--hw/xwin/winclipboardxevents.c3
-rw-r--r--hw/xwin/winconfig.c77
-rw-r--r--hw/xwin/winkeybd.c8
-rw-r--r--hw/xwin/winkeybd.h16
-rw-r--r--hw/xwin/winkeyhook.c4
-rw-r--r--hw/xwin/winkeynames.h13
-rw-r--r--hw/xwin/winlayouts.h8
7 files changed, 74 insertions, 55 deletions
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index 2f042fd0b..8b502b117 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -789,6 +789,9 @@ winClipboardFlushXEvents (HWND hwnd,
case PropertyNotify:
break;
+ case MappingNotify:
+ break;
+
default:
ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type);
break;
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index 758c54d89..76bf8e2de 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -240,6 +240,7 @@ Bool
winConfigKeyboard (DeviceIntPtr pDevice)
{
char layoutName[KL_NAMELENGTH];
+ unsigned char layoutFriendlyName[256];
static unsigned int layoutNum = 0;
int keyboardType;
#ifdef XWIN_XF86CONFIG
@@ -299,11 +300,32 @@ winConfigKeyboard (DeviceIntPtr pDevice)
if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
winMsg (X_INFO, "Loading US keyboard layout.\n");
else
- winMsg (X_ERROR, "LoadKeyboardLaout failed.\n");
+ winMsg (X_ERROR, "LoadKeyboardLayout failed.\n");
}
}
- winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n",
- layoutName, layoutNum);
+
+ /* Discover the friendly name of the current layout */
+ {
+ HKEY regkey = NULL;
+ const char regtempl[] = "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
+ char *regpath;
+ DWORD namesize = sizeof(layoutFriendlyName);
+
+ regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1);
+ strcpy(regpath, regtempl);
+ strcat(regpath, layoutName);
+
+ if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, &regkey))
+ RegQueryValueEx(regkey, "Layout Text", 0, NULL, layoutFriendlyName, &namesize);
+
+ /* Close registry key */
+ if (regkey)
+ RegCloseKey (regkey);
+ free(regpath);
+ }
+
+ winMsg (X_PROBED, "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
+ layoutName, layoutNum, layoutFriendlyName, keyboardType);
for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
{
@@ -311,46 +333,35 @@ winConfigKeyboard (DeviceIntPtr pDevice)
continue;
if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
continue;
-
+
bfound = TRUE;
winMsg (X_PROBED,
- "Using preset keyboard for \"%s\" (%x), type \"%d\"\n",
- pLayout->layoutname, pLayout->winlayout, keyboardType);
-
+ "Found matching XKB configuration \"%s\"\n",
+ pLayout->layoutname);
+
+ winMsg(X_PROBED,
+ "Model = \"%s\" Layout = \"%s\""
+ " Variant = \"%s\" Options = \"%s\"\n",
+ pLayout->xkbmodel ? pLayout->xkbmodel : "none",
+ pLayout->xkblayout ? pLayout->xkblayout : "none",
+ pLayout->xkbvariant ? pLayout->xkbvariant : "none",
+ pLayout->xkboptions ? pLayout->xkboptions : "none");
+
g_winInfo.xkb.model = pLayout->xkbmodel;
g_winInfo.xkb.layout = pLayout->xkblayout;
g_winInfo.xkb.variant = pLayout->xkbvariant;
- g_winInfo.xkb.options = pLayout->xkboptions;
+ g_winInfo.xkb.options = pLayout->xkboptions;
+
+
break;
}
-
+
if (!bfound)
{
- HKEY regkey = NULL;
- const char regtempl[] =
- "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
- char *regpath;
- unsigned char lname[256];
- DWORD namesize = sizeof(lname);
-
- regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1);
- strcpy(regpath, regtempl);
- strcat(regpath, layoutName);
-
- if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, &regkey) &&
- !RegQueryValueEx(regkey, "Layout Text", 0, NULL, lname, &namesize))
- {
- winMsg (X_ERROR,
- "Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName);
- }
-
- /* Close registry key */
- if (regkey)
- RegCloseKey (regkey);
- free(regpath);
+ winMsg (X_ERROR, "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName);
}
- }
-
+ }
+
/* parse the configuration */
#ifdef XWIN_XF86CONFIG
if (g_cmdline.keyboard)
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 83fea21cd..9e5a9b02a 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -73,6 +73,8 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
int iParam = HIWORD (lParam);
int iParamScanCode = LOBYTE (iParam);
+ winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam);
+
/* WM_ key messages faked by Vista speech recognition (WSR) don't have a
* scan code.
*
@@ -488,10 +490,8 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
for (i = 0; i < nevents; i++)
mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event);
-#if CYGDEBUG
- ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
- dwKey, fDown, nevents);
-#endif
+ winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
+ dwKey, fDown, nevents);
}
BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index 5b2a5892f..4e4c35c37 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -216,13 +216,13 @@ g_iKeyMap [] = {
/* 170 */ 0, 0, 0,
/* 171 */ 0, 0, 0,
/* 172 */ 0, 0, 0,
- /* 173 */ 0, 0, 0,
- /* 174 */ 0, 0, 0,
- /* 175 */ 0, 0, 0,
- /* 176 */ 0, 0, 0,
- /* 177 */ 0, 0, 0,
- /* 178 */ 0, 0, 0,
- /* 179 */ 0, 0, 0,
+ /* 173 */ VK_VOLUME_MUTE, 0, KEY_Mute,
+ /* 174 */ VK_VOLUME_DOWN, 0, KEY_AudioLower,
+ /* 175 */ VK_VOLUME_UP, 0, KEY_AudioRaise,
+ /* 176 */ VK_MEDIA_NEXT_TRACK, 0, KEY_NEXTSONG,
+ /* 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,
/* 181 */ 0, 0, 0,
/* 182 */ 0, 0, 0,
@@ -266,7 +266,7 @@ g_iKeyMap [] = {
/* 220 */ 0, 0, 0,
/* 221 */ 0, 0, 0,
/* 222 */ 0, 0, 0,
- /* 223 */ 0, 0, 0,
+ /* 223 */ VK_OEM_8, 0, KEY_RCtrl, /* at least on Candian Multilingual Standard layout */
/* 224 */ 0, 0, 0,
/* 225 */ 0, 0, 0,
/* 226 */ 0, 0, 0,
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index fe1156dcf..cbee7cbda 100644
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -88,9 +88,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
/* Pass keystrokes on to our main message loop */
if (iCode == HC_ACTION)
{
-#if 0
- ErrorF ("vkCode: %08x\tscanCode: %08x\n", p->vkCode, p->scanCode);
-#endif
+ winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n", p->vkCode, p->scanCode);
switch (wParam)
{
diff --git a/hw/xwin/winkeynames.h b/hw/xwin/winkeynames.h
index 3d5938348..914016a76 100644
--- a/hw/xwin/winkeynames.h
+++ b/hw/xwin/winkeynames.h
@@ -23,10 +23,6 @@
*
*/
-#define XK_TECHNICAL
-#define XK_KATAKANA
-#include <X11/keysym.h>
-
#define GLYPHS_PER_KEY 4
#define NUM_KEYCODES 248
#define MIN_KEYCODE 8
@@ -194,6 +190,15 @@
#define KEY_HKTG /* Hirugana/Katakana tog 0xc8 */ 200
#define KEY_BSlash2 /* \ _ 0xcb */ 203
+#define KEY_Mute /* Audio Mute */ 152
+#define KEY_AudioLower /* Audio Lower */ 168
+#define KEY_AudioRaise /* Audio Raise */ 166
+
+#define KEY_NEXTSONG /* Media next */ 145
+#define KEY_PLAYPAUSE /* Media play/pause toggle */ 154
+#define KEY_PREVIOUSSONG /* Media previous */ 136
+#define KEY_STOPCD /* Media stop */ 156
+
/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h
index 9500689bc..ce502a005 100644
--- a/hw/xwin/winlayouts.h
+++ b/hw/xwin/winlayouts.h
@@ -55,13 +55,15 @@ WinKBLayoutRec winKBLayouts[] =
{ 0x00010409, -1, "pc105", "dvorak", NULL, NULL, "English (USA,Dvorak)"},
{ 0x00020409, -1, "pc105", "us_intl", NULL, NULL, "English (USA,International)"},
{ 0x00000809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"},
+ { 0x00001009, -1, "pc105", "ca", "fr", NULL, "French (Canada)"},
+ { 0x00011009, -1, "pc105", "ca", "multix", NULL, "Canadian Multilingual Standard"},
{ 0x00001809, -1, "pc105", "ie", NULL, NULL, "Irish"},
{ 0x0000040a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain,Traditional Sort)"},
{ 0x0000080a, -1, "pc105", "latam", NULL, NULL, "Latin American"},
{ 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"},
{ 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
{ 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
- { 0x00000c0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"},
+ { 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada, Legacy)"},
{ 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"},
{ 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"},
{ 0x0000040e, -1, "pc105", "hu", NULL, NULL, "Hungarian"},
@@ -79,6 +81,8 @@ WinKBLayoutRec winKBLayouts[] =
{ 0x00000816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"},
{ 0x0000041a, -1, "pc105", "hr", NULL, NULL, "Croatian"},
{ 0x0000041d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"},
+ { 0x0000041f, -1, "pc105", "tr", NULL, NULL, "Turkish (Q)"},
+ { 0x0001041f, -1, "pc105", "tr", "f", NULL, "Turkish (F)"},
{ 0x00000424, -1, "pc105", "si", NULL, NULL, "Slovenian"},
{ 0x00000425, -1, "pc105", "ee", NULL, NULL, "Estonian"},
{ 0x00000452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"},
@@ -89,5 +93,3 @@ WinKBLayoutRec winKBLayouts[] =
See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx
for a listing of input locale (keyboard layout) codes
*/
-
-