Commit 8793e362 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Improve DEBUG/TEST output regarding keyboard stuff

parent e3ac55bc
...@@ -477,6 +477,11 @@ CARD8 nxagentConvertKeycode(CARD8 k) ...@@ -477,6 +477,11 @@ CARD8 nxagentConvertKeycode(CARD8 k)
{ {
if (nxagentKeycodeConversion != 0) if (nxagentKeycodeConversion != 0)
{ {
#ifdef DEBUG
if (k != nxagentConvertedKeycodes[k])
fprintf(stderr, "nxagentConvertKeycode: converting keycode [%d] to [%d]\n", k, nxagentConvertedKeycodes[k]);
#endif
return nxagentConvertedKeycodes[k]; return nxagentConvertedKeycodes[k];
} }
else else
...@@ -501,10 +506,10 @@ static void nxagentCheckXkbBaseDirectory(void) ...@@ -501,10 +506,10 @@ static void nxagentCheckXkbBaseDirectory(void)
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCheckXkbBaseDirectory: " fprintf(stderr, "nxagentCheckXkbBaseDirectory: "
"Before calling _NXGetXkbBasePath.\n"); "Before calling _NXGetXkbBasePath:\n");
fprintf(stderr, "nxagentCheckXkbBaseDirectory: " fprintf(stderr, "nxagentCheckXkbBaseDirectory: "
"XkbBaseDirectory varible [%s].\n", "XkbBaseDirectory variable [%s].\n",
XkbBaseDirectory); XkbBaseDirectory);
#endif #endif
...@@ -512,10 +517,10 @@ static void nxagentCheckXkbBaseDirectory(void) ...@@ -512,10 +517,10 @@ static void nxagentCheckXkbBaseDirectory(void)
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCheckXkbBaseDirectory: " fprintf(stderr, "nxagentCheckXkbBaseDirectory: "
"After calling _NXGetXkbBasePath.\n"); "After calling _NXGetXkbBasePath:\n");
fprintf(stderr, "nxagentCheckXkbBaseDirectory: " fprintf(stderr, "nxagentCheckXkbBaseDirectory: "
"XkbBaseDirectory varible [%s].\n", "XkbBaseDirectory variable [%s].\n",
XkbBaseDirectory); XkbBaseDirectory);
#endif #endif
...@@ -877,6 +882,10 @@ XkbError: ...@@ -877,6 +882,10 @@ XkbError:
fprintf(stderr, "nxagentKeyboardProc: Using XKB extension.\n"); fprintf(stderr, "nxagentKeyboardProc: Using XKB extension.\n");
#endif #endif
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL");
#endif
memset(&names, 0, sizeof(XkbComponentNamesRec)); memset(&names, 0, sizeof(XkbComponentNamesRec));
rules = nxagentXkbGetRules(); rules = nxagentXkbGetRules();
...@@ -988,6 +997,11 @@ XkbError: ...@@ -988,6 +997,11 @@ XkbError:
} }
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n");
#endif #endif
#ifdef DEBUG
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
"[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
rules, model, layout, variants, options);
#endif
XkbSetRulesDflts(rules, model, layout, variants, options); XkbSetRulesDflts(rules, model, layout, variants, options);
XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
...@@ -1072,12 +1086,13 @@ XkbError: ...@@ -1072,12 +1086,13 @@ XkbError:
else else
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: No config file.\n");
#endif
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: No config file, going to set rules and init device.\n"); fprintf(stderr, "nxagentKeyboardProc: No config file, going to set rules and init device.\n");
#endif #endif
#ifdef DEBUG
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
"[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
rules, model, layout, variants, options);
#endif
XkbSetRulesDflts(rules, model, layout, variants, options); XkbSetRulesDflts(rules, model, layout, variants, options);
XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
...@@ -1097,6 +1112,11 @@ XkbError: ...@@ -1097,6 +1112,11 @@ XkbError:
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n");
#endif #endif
#ifdef DEBUG
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
"[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
rules, model, layout, variants, options);
#endif
XkbSetRulesDflts(rules, model, layout, variants, options); XkbSetRulesDflts(rules, model, layout, variants, options);
XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
...@@ -1402,8 +1422,8 @@ void nxagentCheckRemoteKeycodes() ...@@ -1402,8 +1422,8 @@ void nxagentCheckRemoteKeycodes()
nxagentNumLockKeycode = XKeysymToKeycode(nxagentDisplay, XK_Num_Lock); nxagentNumLockKeycode = XKeysymToKeycode(nxagentDisplay, XK_Num_Lock);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentCheckRemoteKeycodes: Remote CapsLock keycode " fprintf(stderr, "nxagentCheckRemoteKeycodes: Remote keycodes: CapsLock "
"is [%d] NumLock [%d].\n", nxagentCapsLockKeycode, "[%d] NumLock [%d].\n", nxagentCapsLockKeycode,
nxagentNumLockKeycode); nxagentNumLockKeycode);
#endif #endif
} }
...@@ -1805,8 +1825,8 @@ void nxagentKeycodeConversionSetup(void) ...@@ -1805,8 +1825,8 @@ void nxagentKeycodeConversionSetup(void)
if (drulesLen != 0 && drules != NULL && dmodel != NULL) if (drulesLen != 0 && drules != NULL && dmodel != NULL)
{ {
fprintf(stderr, "nxagentKeycodeConversionSetup: " fprintf(stderr, "nxagentKeycodeConversionSetup: "
"Remote: [%s,%s,%s,%s,%s].\n", drules, dmodel, dlayout, "Remote: [rules='%s',model='%s',layout='%s',variant='%s',options='%s'].\n",
dvariant, doptions); drules, dmodel, dlayout, dvariant, doptions);
} }
else else
{ {
...@@ -1862,6 +1882,11 @@ void nxagentKeycodeConversionSetup(void) ...@@ -1862,6 +1882,11 @@ void nxagentKeycodeConversionSetup(void)
(strcmp(drules, "evdev") == 0 || (strcmp(drules, "evdev") == 0 ||
strcmp(dmodel, "evdev") == 0)) strcmp(dmodel, "evdev") == 0))
{ {
#ifdef DEBUG
fprintf(stderr, "nxagentKeycodeConversionSetup: "
"Activating KeyCode conversion.\n");
#endif
nxagentKeycodeConversion = 1; nxagentKeycodeConversion = 1;
} }
......
...@@ -223,8 +223,8 @@ static int NXVerifyXkbBaseDirectory(const char *dirPath) ...@@ -223,8 +223,8 @@ static int NXVerifyXkbBaseDirectory(const char *dirPath)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "NXVerifyXkbBaseDirectory: Can't find the keymap.dir file [%s].\n", fprintf(stderr, "NXVerifyXkbBaseDirectory: Xkb Base Directory [%s] is not valid (can't find file [%s]).\n",
rulesBaseFilePath); dirPath, rulesBaseFilePath);
#endif #endif
free(rulesBaseFilePath); free(rulesBaseFilePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment