Using wxWidgets 2-9-5 (yes, I know it's old but it's what I have to work with), I seem to be running into the strangest issue with menu accelerators. Using the alt+ works, but not Ctrl+. Any menu item whose shortcut starts with "Alt" works correctly. None of the ones with "Ctrl" do. At this point, I'm certain I'm overlooking something incredibly obvious, but I can't figure it out.
file_menu = new wxMenu;
file_menu->Append(MENU_NEW, "New project\tCtrl+N");
file_menu->Append(MENU_OPEN, "Load project\tCtrl+L");
file_menu->Append(MENU_SaveInput, "Save input\tCtrl+S");
file_menu->Append(MENU_SaveInputAs,"Save input as...\tCtrl+I");
file_menu->AppendSeparator();
file_menu->Append(MENU_QUIT, "Exit\tAlt+F4");
Do I need an accelerator table for some reason?
Menu accelerator issue Topic is solved
Re: Menu accelerator issue
Which platform?
Did you check any of the samples that use keyboard shortcuts with "Ctrl"? E.g. the "stc" sample does.
Make a test with wx 3.x. If it works there, it means there was a bug in 2.9.5 that has been fixed by now.
Did you check any of the samples that use keyboard shortcuts with "Ctrl"? E.g. the "stc" sample does.
Make a test with wx 3.x. If it works there, it means there was a bug in 2.9.5 that has been fixed by now.
Use the source, Luke!
Re: Menu accelerator issue
Windows 7, and yes the samples work. I'm at a total loss.
Re: Menu accelerator issue
I can't think of any obvious reason either.Windows 7, and yes the samples work. I'm at a total loss.
I assume the event handlers work when you invoke the menu items directly?
Do you have any key event handlers?
Either try to reproduce the issue in a minimal sample or try stripping down your code until you've isolated the issue.
Use the source, Luke!
Re: Menu accelerator issue
Yes, direct invocation from the menu works. Replacing "Ctrl+L" with "Alt+L" works. It seems to be isolated to the use of the "Control" key, like something is catching any keyboard event that starts with "Ctrl".doublemax wrote: ↑Tue Mar 19, 2019 11:34 pmI can't think of any obvious reason either.Windows 7, and yes the samples work. I'm at a total loss.
I assume the event handlers work when you invoke the menu items directly?
Do you have any key event handlers?
Either try to reproduce the issue in a minimal sample or try stripping down your code until you've isolated the issue.
Re: Menu accelerator issue
Hi,
As doublemax suggested - do you have any keyboard events intercepted?
Thank you.
As doublemax suggested - do you have any keyboard events intercepted?
Thank you.
Re: Menu accelerator issue
Hi,
Just try to search globally for 'wxKeyEvent'...
Thank you.
Just try to search globally for 'wxKeyEvent'...
Thank you.