From e7b5ee117eed1309f3f157ff65f07c07ddcde949 Mon Sep 17 00:00:00 2001 From: Jeff Backus Date: Sun, 18 Sep 2016 17:49:09 -0400 Subject: [PATCH 1/3] Added note re: mapping keys 0-9. --- src/qtx11keymapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qtx11keymapper.cpp b/src/qtx11keymapper.cpp index c402922e..59e57585 100644 --- a/src/qtx11keymapper.cpp +++ b/src/qtx11keymapper.cpp @@ -283,6 +283,7 @@ void QtX11KeyMapper::populateMappingHashes() qtKeyToVirtualKey[AntKey_Alt_R] = XK_Alt_R; qtKeyToVirtualKey[AntKey_KP_Multiply] = XK_KP_Multiply; + // Map 0 to 9 for (int i=0; i <= (XK_KP_9 - XK_KP_0); i++) { qtKeyToVirtualKey[AntKey_KP_0 + i] = XK_KP_0 + i; From 9910a95aa77c41f096f3c222b80a2552d466cc53 Mon Sep 17 00:00:00 2001 From: Jeff Backus Date: Sun, 18 Sep 2016 17:54:43 -0400 Subject: [PATCH 2/3] Added extended characters from 0x0a0 - 0x0ff for non-US keyboards. Hopefully this will resolve issue #49. --- src/qtx11keymapper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qtx11keymapper.cpp b/src/qtx11keymapper.cpp index 59e57585..d6e5bfde 100644 --- a/src/qtx11keymapper.cpp +++ b/src/qtx11keymapper.cpp @@ -289,6 +289,11 @@ void QtX11KeyMapper::populateMappingHashes() qtKeyToVirtualKey[AntKey_KP_0 + i] = XK_KP_0 + i; } + // Map extended keyboard characters + for( int i=0; i <= (XK_ydiaeresis - XK_nobreakspace); i++) { + qtKeyToVirtualKey[ Qt::Key_nobreakspace + i ] = XK_nobreakspace + i; + } + QHashIterator iter(qtKeyToVirtualKey); while (iter.hasNext()) { From 1a5389adcd651c5be6fdfe0a367333289532a12b Mon Sep 17 00:00:00 2001 From: Jeff Backus Date: Tue, 20 Sep 2016 20:11:41 -0400 Subject: [PATCH 3/3] Looks like actual problem is that Qt doesn't map lower-case Latin characters correctly. Mapping to capitals... Hopefully addresses issue #49. --- src/qtx11keymapper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qtx11keymapper.cpp b/src/qtx11keymapper.cpp index d6e5bfde..aa25424c 100644 --- a/src/qtx11keymapper.cpp +++ b/src/qtx11keymapper.cpp @@ -289,9 +289,12 @@ void QtX11KeyMapper::populateMappingHashes() qtKeyToVirtualKey[AntKey_KP_0 + i] = XK_KP_0 + i; } - // Map extended keyboard characters - for( int i=0; i <= (XK_ydiaeresis - XK_nobreakspace); i++) { - qtKeyToVirtualKey[ Qt::Key_nobreakspace + i ] = XK_nobreakspace + i; + // Map lower-case latin characters to their capital equivalents + for( int i=0; i <= (XK_odiaeresis - XK_agrave); i++) { + qtKeyToVirtualKey[ Qt::Key_Agrave + i ] = XK_agrave + i; + } + for( int i=0; i <= (XK_thorn - XK_oslash); i++) { + qtKeyToVirtualKey[ Qt::Key_Ooblique + i ] = XK_oslash + i; } QHashIterator iter(qtKeyToVirtualKey);