Fix Keyboard shortcut (alt + letter) does not work in input widget-Windows (#1122)

This commit is contained in:
ManoloFLTK 2024-11-12 09:08:42 +01:00
parent dc2c53333c
commit 0d4c8c8534

View File

@ -332,10 +332,11 @@ void Fl_WinAPI_Screen_Driver::get_system_colors()
int Fl_WinAPI_Screen_Driver::compose(int &del) { int Fl_WinAPI_Screen_Driver::compose(int &del) {
unsigned char ascii = (unsigned char)Fl::e_text[0]; unsigned char ascii = (unsigned char)Fl::e_text[0];
/* WARNING: The [AltGr] key on international keyboards falsely set FL_CTRL! */ /* WARNING: The [AltGr] key on international keyboards sets FL_CTRL.
/* More investigation needed. */ 2nd line in condition below asks [AltGr] key (a.k.a. VK_RMENU) not to be down.
int condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && */
!(GetAsyncKeyState(VK_MENU) >> 15) && !(ascii & 128); int condition = (Fl::e_state & (FL_ALT | FL_META | FL_CTRL)) && !(ascii & 128) &&
!( (Fl::e_state & FL_CTRL) && (GetAsyncKeyState(VK_RMENU) >> 15) );
if (condition) { // this stuff is to be treated as a function key if (condition) { // this stuff is to be treated as a function key
del = 0; del = 0;
return 0; return 0;