Skip to main content
January 7, 2010
Question

How to create keyboard shortcuts to buttons on a dailog

  • January 7, 2010
  • 3 replies
  • 1010 views

Has anyone created keyboard shortcuts to buttons on a dialog ? If so, how did you do it ?

I have tried replace the dialog event handler with my own. It gets the mouse clicks, but keyboard events are not passed to the my event handler. They get intercepted before.

This topic has been closed for replies.

3 replies

January 22, 2010

I have found an answer. And it out it can't be done.

I think the "&" is for menu entires keyboard shortcuts.

Inspiring
January 7, 2010

Have a try with IKeyBoard::AcquireKeyFocus.

Dirk

January 13, 2010

I have tried this. It does gives my eventhandler the keyboard focus. But it is lost again and not be reatored, if the user selects a text edit box or a dropdown on the dialog.

I have been looking at the IShortcutManager and the iShortcutContext, but have not yet been successful at getting it to work.

Inspiring
January 13, 2010

Do you by any chance mean those Windows specific Alt+Whatever shortcuts? I think you just add an "&" ampersand to the widget text and that's it. Could be I'm wrong, I haven't done any PC specific work for a while. Also remember, in CS4 some widgets have a flag in their resources whether the ampersand should be converted to an underline.

Dirk

Bartek_Kropaczewski
Inspiring
January 7, 2010

Hi

Thin you need to create your own Interface like IID_IYOUREVENTHANDLER and add it to kYourDialogBoss;

Then delegate all events like in CusDtLnkUITreeNodeEH

Regards

Bartek