From f4009305c7dc62055ffe4e5265782fc37270ec82 Mon Sep 17 00:00:00 2001 From: Matt Chapman Date: Thu, 26 Sep 2002 14:11:59 +0000 Subject: [PATCH] Suppress missing translation warnings if the keymap was "none" or doesn't exist (in the latter case the user already receives an error). git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@204 423420c4-83ab-492f-b58f-81f9feb106b5 --- xkeymap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xkeymap.c b/xkeymap.c index b3806c6..685032c 100644 --- a/xkeymap.c +++ b/xkeymap.c @@ -36,6 +36,7 @@ extern char keymapname[16]; extern int keylayout; extern BOOL enable_compose; +static BOOL keymap_loaded; static key_translation keymap[KEYMAP_SIZE]; static int min_keycode; static uint16 remote_modifier_state = 0; @@ -206,7 +207,10 @@ xkeymap_init(void) unsigned int max_keycode; if (strcmp(keymapname, "none")) - xkeymap_read(keymapname); + { + if (xkeymap_read(keymapname)) + keymap_loaded = True; + } XDisplayKeycodes(display, &min_keycode, (int *) &max_keycode); } @@ -324,7 +328,8 @@ xkeymap_translate_key(uint32 keysym, unsigned int keycode, unsigned int state) return tr; } - DEBUG_KBD(("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym))); + if (keymap_loaded) + error("No translation for (keysym 0x%lx, %s)\n", keysym, get_ksname(keysym)); /* not in keymap, try to interpret the raw scancode */ if ((keycode >= min_keycode) && (keycode <= 0x60))