WinForms ContextMenuStrip item shortcuts conflict with IME (Chinese/Japanese)

48 Views Asked by At

Our Windows Forms application has a custom ContextMenuStrip for a textbox. The ContextMenuStrip items have the ampersand shortcut keys (e.g. Select &All) such that if the user performs Right-Click + a, it will call the "Select All" click handler.

This works fine in English IME. However, if I switch to Chinese or Japanese IME, after Right-Click, if I press another letter in the keyboard, instead of calling the context menu shortcut, it will bringout the IME options in the textbox. This renders the shortcuts useless.

This behaviour does not occur in standard Windows Textboxes. Any idea how to fix this? I have dabbled with Focus() and ImeMode to no avail.

By the way, the textbox is not restricted to any particular IME (should support all languages).

And just to clarify, I have also enabled keyboard Shortcuts like Ctrl+C and Ctrl+V on the ContextMenu/Textbox, but that is a different thing. My question is for the right-click + letter shortcut.

Thanks in advance. Screenshot

0

There are 0 best solutions below