I use VK_OEM_MINUS (VIRTKEY) as a menu accelerator in my Visual C++ project and it works perfectly when I press “-/_” key on QWERTY keyboards.
But when I use French keyboard layout it doesn’t work. The “-” is placed on “6” key in French layout, and it looks like it uses other key code.
I’m wondering how can I use MINUS key for AZERTY keyboards? I’m looking for a way to reuse my code without reassigning accelerator keys. I prefer to use MINUS as accelerator on any keyboard.
UPDATE: I’ve tried to use ASCII rather than virtual key: "-", ID_MENUITEM, ASCII, NOINVERT, but nothing happened, it still doesn’t work. (Win7, MSVC2010)
UPDATE: Changed the notebook and used Win7 and MSVC2008 – the ASCII accelerator works now, but it looks like I can’t process Ctrl+, Shift+(-) combinations via the accelerator table.
UPDATE: It looks like VK_OEM_MINUS (0xBD) doesn’t exist at all for French keyboard layout and it can’t be generated by French keyboards.
This is just a fast solution I applied because of I didn’t want neither to use other accelerators for AZERTY keyboard nor to implement user-defined accelerators.
Since VK_OEM_MINUS can’t be generated on AZERTY keyboards, I faked a key press by posting (WM_KEYDOWN, VK_OEM_MINUS) when VK_KEY_6 is pressed (only for AZERTY).