hotkey selector dialog: accept hotkey using Alt key modifier on Windows.

On Windows, Alt key is specific, and the dialog did not accept the modifier

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17453
This commit is contained in:
jean-pierre charras 2024-03-18 18:16:37 +01:00
parent 3b47fd1503
commit 0fab12f367
1 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2016 Chris Pavlina <pavlina.chris@gmail.com> * Copyright (C) 2016 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -202,12 +202,14 @@ protected:
// Let EVT_CHAR handle this one // Let EVT_CHAR handle this one
aEvent.DoAllowNextEvent(); aEvent.DoAllowNextEvent();
// On Windows, wxEvent::Skip must NOT be called. #ifdef __WXMSW__
// On Linux and OSX, wxEvent::Skip MUST be called. // On Windows, looks like a OnChar event is not generated when
// No, I don't know why. // using the Alt key modifier. So ensure m_event is up to date
#ifndef __WXMSW__ // to handle the right key code when releasing the key and therefore
aEvent.Skip(); // closing the dialog
m_event = aEvent;
#endif #endif
aEvent.Skip();
} }
else else
{ {