aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin')
-rw-r--r--xorg-server/hw/xwin/winconfig.c77
-rw-r--r--xorg-server/hw/xwin/winkeybd.c5
-rw-r--r--xorg-server/hw/xwin/winkeyhook.c1
-rw-r--r--xorg-server/hw/xwin/winkeynames.h4
-rw-r--r--xorg-server/hw/xwin/winlayouts.h8
5 files changed, 54 insertions, 41 deletions
diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c
index f654d13da..1325e77a6 100644
--- a/xorg-server/hw/xwin/winconfig.c
+++ b/xorg-server/hw/xwin/winconfig.c
@@ -239,6 +239,7 @@ Bool
winConfigKeyboard (DeviceIntPtr pDevice)
{
char layoutName[KL_NAMELENGTH];
+ unsigned char layoutFriendlyName[256];
static unsigned int layoutNum = 0;
int keyboardType;
#ifdef XWIN_XF86CONFIG
@@ -298,11 +299,32 @@ winConfigKeyboard (DeviceIntPtr pDevice)
if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL)
winDebug("Loading US keyboard layout.\n");
else
- ErrorF ("LoadKeyboardLaout failed.\n");
+ ErrorF ("LoadKeyboardLayout failed.\n");
}
}
- winDebug ("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);
+ }
+
+ winDebug ("Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n",
+ layoutName, layoutNum, layoutFriendlyName, keyboardType);
for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++)
{
@@ -310,44 +332,35 @@ winConfigKeyboard (DeviceIntPtr pDevice)
continue;
if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType)
continue;
-
+
bfound = TRUE;
- winDebug ("Using preset keyboard for \"%s\" (%x), type \"%d\"\n",
- pLayout->layoutname, pLayout->winlayout, keyboardType);
-
+ winDebug (
+ "Found matching XKB configuration \"%s\"\n",
+ pLayout->layoutname);
+
+ winDebug(
+ "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))
- {
- ErrorF ("Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName);
- }
-
- /* Close registry key */
- if (regkey)
- RegCloseKey (regkey);
- free(regpath);
+ ErrorF ("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/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c
index c72fbe275..4711a0d96 100644
--- a/xorg-server/hw/xwin/winkeybd.c
+++ b/xorg-server/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.
*
@@ -115,6 +117,7 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
}
}
+
/* Ring the keyboard bell (system speaker on PCs) */
static void
winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
@@ -488,7 +491,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event);
winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
- dwKey, fDown, nevents);
+ dwKey, fDown, nevents);
}
BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/xorg-server/hw/xwin/winkeyhook.c b/xorg-server/hw/xwin/winkeyhook.c
index 7f75a563b..e452fa5f7 100644
--- a/xorg-server/hw/xwin/winkeyhook.c
+++ b/xorg-server/hw/xwin/winkeyhook.c
@@ -88,6 +88,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
/* Pass keystrokes on to our main message loop */
if (iCode == HC_ACTION)
{
+ winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n", p->vkCode, p->scanCode);
switch (wParam)
{
diff --git a/xorg-server/hw/xwin/winkeynames.h b/xorg-server/hw/xwin/winkeynames.h
index 39574d393..a6738330e 100644
--- a/xorg-server/hw/xwin/winkeynames.h
+++ b/xorg-server/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
diff --git a/xorg-server/hw/xwin/winlayouts.h b/xorg-server/hw/xwin/winlayouts.h
index 882e4f71c..c53f0e054 100644
--- a/xorg-server/hw/xwin/winlayouts.h
+++ b/xorg-server/hw/xwin/winlayouts.h
@@ -56,7 +56,7 @@ WinKBLayoutRec winKBLayouts[] =
{ 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, "Candian Multilingual Standard"},
+ { 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"},
@@ -64,7 +64,7 @@ WinKBLayoutRec winKBLayouts[] =
{ 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"},
{ 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"},
{ 0x0001080c, -1, "pc105", "be", NULL, NULL, "Belgian (Comma)"},
- { 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada) (Legacy)"},
+ { 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"},
@@ -82,6 +82,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)"},
@@ -92,5 +94,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
*/
-
-