From daf3c7b07089f2c46b13ef443d6b541e3c6c809a Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 2 Jan 2017 23:16:09 +0000 Subject: [PATCH] GTK, Win32: always map keypad decimal separator to dot. We only accept dot as a decimal separator, but the OS locale may use a comma there. --- CHANGELOG.md | 1 + src/platform/gtkmain.cpp | 4 ++++ src/platform/w32main.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df3fb798..e59c2ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Other new features: * When selecting a point and a line, projected distance to to current workplane is displayed. * The "=" key is bound to "Zoom In", like "+" key. + * The numpad decimal separator key is bound to "." regardless of locale. Bugs fixed: * A point in 3d constrained to any line whose length is free no longer diff --git a/src/platform/gtkmain.cpp b/src/platform/gtkmain.cpp index 3486158d..bd82066a 100644 --- a/src/platform/gtkmain.cpp +++ b/src/platform/gtkmain.cpp @@ -512,6 +512,10 @@ protected: chr = '\b'; break; + case GDK_KEY_KP_Decimal: + chr = '.'; + break; + default: if(event->keyval >= GDK_KEY_F1 && event->keyval <= GDK_KEY_F12) { chr = GraphicsWindow::FUNCTION_KEY_BASE + (event->keyval - GDK_KEY_F1); diff --git a/src/platform/w32main.cpp b/src/platform/w32main.cpp index e2ec91a7..6f414670 100644 --- a/src/platform/w32main.cpp +++ b/src/platform/w32main.cpp @@ -689,6 +689,7 @@ static bool ProcessKeyDown(WPARAM wParam) case VK_OEM_6: c = ']'; break; case VK_OEM_5: c = '\\'; break; case VK_OEM_PERIOD: c = '.'; break; + case VK_DECIMAL: c = '.'; break; case VK_SPACE: c = ' '; break; case VK_DELETE: c = 127; break; case VK_TAB: c = '\t'; break;