changeset 9016:448e20d9999f 9-b62

RT-39804: Apostrophe as dead key doesn't work on Windows 8.1 Latvian (Standard) keyboard layout Reviewed-by: ckyang, ddhill
author leifs
date Fri, 24 Apr 2015 09:58:23 -0700
parents caebda747638
children 756b3a96854c 6b162a05e262
files modules/graphics/src/main/native-glass/win/ViewContainer.cpp
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Thu Apr 23 14:50:21 2015 -0700
+++ b/modules/graphics/src/main/native-glass/win/ViewContainer.cpp	Fri Apr 24 09:58:23 2015 -0700
@@ -645,6 +645,35 @@
 
                 default:     comp[1] = static_cast<wchar_t>(m_deadKeyWParam); break;
             }
+        } else if (HIWORD(m_kbLayout) == 0xF0B1 && LOBYTE(m_idLang) == LANG_LATVIAN) {
+            // The Latvian (Standard) keyboard, available in Win 8.1 and later.
+            switch (m_deadKeyWParam) {
+                case L'\'':
+                case L'"':
+                    // Note: " is Shift-' and automatically capitalizes the typed
+                    // character in native Win 8.1 apps. We don't do this, so the user
+                    // needs to keep the Shift key down. This is probably the common use
+                    // case anyway.
+                    switch (wParam) {
+                        case L'A': case L'a':
+                        case L'E': case L'e':
+                        case L'I': case L'i':
+                        case L'U': case L'u':
+                             comp[1] = 0x304; break; // macron
+                        case L'C': case L'c':
+                        case L'S': case L's':
+                        case L'Z': case L'z':
+                             comp[1] = 0x30c; break; // caron
+                        case L'G': case L'g':
+                        case L'K': case L'k':
+                        case L'L': case L'l':
+                        case L'N': case L'n':
+                             comp[1] = 0x327; break; // cedilla
+                        default:
+                             comp[1] = static_cast<wchar_t>(m_deadKeyWParam); break;
+                    } break;
+                default:     comp[1] = static_cast<wchar_t>(m_deadKeyWParam); break;
+            }
         } else {
             switch (m_deadKeyWParam) {
                 case L'`':   comp[1] = 0x300; break;
@@ -658,6 +687,7 @@
                 case 0x02D9: comp[1] = 0x307; break;
                 case L'"':   comp[1] = 0x308; break;
                 case 0x00A8: comp[1] = 0x308; break;
+                case 0x00B0: comp[1] = 0x30A; break;
                 case 0x02DA: comp[1] = 0x30A; break;
                 case 0x02DD: comp[1] = 0x30B; break;
                 case 0x02C7: comp[1] = 0x30C; break;