From 3fbd4f944f0a6e16630974e56e1e896eb7bbf6f7 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 10 Sep 2024 12:14:56 +0200 Subject: Apply `scaling-shortcut-kludge.patch` for Windows ... as proposed by Manolo in a private mail. This patch allows to detect "ctrl+'-' on keyboards with digits in uppercase positions (e.g. French)" but this is only preliminary for FLTK 1.4.0. Windows keyboard handling should be revised in FLTK 1.5.0 or higher. --- src/Fl_win32.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 45474fd0f..36e77a99b 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,7 +1,7 @@ // // Windows-specific code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -1157,6 +1157,7 @@ static const struct { {0xdc, '\\'}, {0xdd, ']'}, {0xde, '\''}, + {VK_OEM_PLUS, '+'}, {VK_OEM_102, FL_Iso_Key} }; static int ms2fltk(WPARAM vk, int extended) { @@ -1439,6 +1440,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_SYSKEYUP: // save the keysym until we figure out the characters: Fl::e_keysym = Fl::e_original_keysym = ms2fltk(wParam, lParam & (1 << 24)); + // Kludge to allow recognizing ctrl+'-' on keyboards with digits in uppercase positions (e.g. French) + if (Fl::e_keysym == '6' && (VkKeyScanA('-') & 0xff) == '6') { + Fl::e_keysym = '-'; + } // See if TranslateMessage turned it into a WM_*CHAR message: if (PeekMessageW(&fl_msg, hWnd, WM_CHAR, WM_SYSDEADCHAR, PM_REMOVE)) { uMsg = fl_msg.message; -- cgit v1.2.3