mity / mctrl

C library providing set of additional user interface controls for Windows, intended to be complementary to standard Win32API controls from USER32.DLL and COMCTL32.DLL.
http://mctrl.org
235 stars 52 forks source link

Menubar: Don't treat AltGr as Alt #50

Closed vslavik closed 7 years ago

vslavik commented 7 years ago

On keyboards that differentiate between the Alt and AltGr keys and use the latter for entering characters (e.g. German or Czech keyboards), AltGr shouldn’t be used a menu shortcut — but mCtrl doesn’t distinguish between them.

Steps to reproduce: in an application using mCtrl menubar, try to type € using Czech keyboard by pressing AltGr+E (or left Ctrl+Alt+E, which is the same thing due to how AltGr is represented in win32). Observe how the menu gets highlighted as you release AltGr. Compare with Notepad where this doesn’t happen.

Fortunately it’s easy to distinguish them: VK_MENU corresponds to Alt only in WM_SYSKEY{DOWN,UP} messages, but not in WM_KEY{DOWN,UP} (source) and so this can be fixed easily. This PR does just that (both Alts continue to work on US keyboard).

mity commented 7 years ago

Thanks for fixing it.