Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Accelerator keys

wkramer
Beginner
443 Views
Hello, I have an SDI application that uses one edit control as simple file viewer. I have associated the key combination Ctrl+C as short cut key with the "copy" menu entry. I use "LoadAccelerators" to load the accelerator table and I use "TranslateAccelerator" in the message loop.
The menu entry for copy does what it has to do and so does the standard short cut for copy (ctrl+insert). But the short cut I defined (ctrl+C) doesn't function. In fact none of the short cut keys I associated to menu entries in the accelerator table do what they should do.

Any ideas? Thanks,

Walter Kramer
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
443 Views
TranslateAccelerator as the first argument has handle of the window accelerator is intended for. I assume that you have in the message
loop:

 
      IF (.NOT.TranslateAccelerator(Mesg%hWnd, hAccelTable, Mesg)) THEN 
            iSt=TranslateMessage(Mesg) 
            iSt=DispatchMessage(Mesg) 
      END IF 


instead, replace it with

IF (.NOT.TranslateAccelerator(hFrame, hAccelTable, Mesg)) THEN
...

and it should work OK (hFrame is apparently the handle of the frame window). The other way, WM_COMMAND goes to the edit control, which neither handles it nor passes it to its parent window.

HTH

Jugoslav
0 Kudos
wkramer
Beginner
443 Views
Yes, you are as always right.

Thank you,

Walter
0 Kudos
Reply