ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

acedFilterWinMsgFn

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
273 Views, 4 Replies

acedFilterWinMsgFn

I am hoping someone will be willing to provide me with an explanation of how
to interpret various values for the members of the MSG parameter provided to
the acedFilterWinMsgFn function. I would like to be able to determine what
combination of keys was pressed by examining the wParam and lParam members,
but I have not been able to find any documentation on how to interpret the
values. I tried to use the following function to figure out the values by
experimentation, but I got some unexpected results.

BOOL filterKeys(MSG *pMsg)
{
// Report Key string
if (pMsg->message == WM_CHAR)
{
acutPrintf("\nKey String: %d", pMsg->wParam);
return true;
}
return false;
}


Thanks,

Chuck

P.S. - I am not an ADN member, so links to docs posted on the ADN website
won't do me any good.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Chuck,

Instead of compare pMsg->message with WM_CHAR, try to compare it with
WM_KEYUP.

The code below should show a message box when the user press CTRL+TAB or
CTRL+F6.

if (pMsg->message == WM_KEYUP &&
GetKeyState(VK_CONTROL) &&
(pMsg->wParam == VK_TAB || pMsg->wParam == VK_F6))
{
AfxMessageBox("CTRL+TAB or CTRL+F6 was pressed!");
}

Hope it helps,

Vinicius

"Chuck Gabriel" escreveu na mensagem
news:ADE7E7CA4C86C16055D7BDFEB3942599@in.WebX.maYIadrTaRb...
> I am hoping someone will be willing to provide me with an explanation of
how
> to interpret various values for the members of the MSG parameter provided
to
> the acedFilterWinMsgFn function. I would like to be able to determine
what
> combination of keys was pressed by examining the wParam and lParam
members,
> but I have not been able to find any documentation on how to interpret the
> values. I tried to use the following function to figure out the values by
> experimentation, but I got some unexpected results.
>
> BOOL filterKeys(MSG *pMsg)
> {
> // Report Key string
> if (pMsg->message == WM_CHAR)
> {
> acutPrintf("\nKey String: %d", pMsg->wParam);
> return true;
> }
> return false;
> }
>
>
> Thanks,
>
> Chuck
>
> P.S. - I am not an ADN member, so links to docs posted on the ADN website
> won't do me any good.
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

Thanks for the tip. I'll explore this more deeply today.

Chuck


"Vinicius Pontes" wrote in message
news:F823EDD8D760A46BD3B1849715FC6095@in.WebX.maYIadrTaRb...
> Chuck,
>
> Instead of compare pMsg->message with WM_CHAR, try to compare it with
> WM_KEYUP.
>
> The code below should show a message box when the user press CTRL+TAB or
> CTRL+F6.
>
> if (pMsg->message == WM_KEYUP &&
> GetKeyState(VK_CONTROL) &&
> (pMsg->wParam == VK_TAB || pMsg->wParam == VK_F6))
> {
> AfxMessageBox("CTRL+TAB or CTRL+F6 was pressed!");
> }
>
> Hope it helps,
>
> Vinicius
Message 4 of 5
Anonymous
in reply to: Anonymous

Any idea why the following code does not prevent AutoCAD's menu accelerators
from working? Since I return TRUE in the case that the ALT key is pressed,
I would expect that the MSG should be terminated and not passed on to
AutoCAD. However, if I load my arx, run the command that installs the hook,
and press ALT-F on the keyboard, AutoCAD's File menu pops up.

BOOL filterKeys(MSG *pMsg)
{
if (pMsg->message == WM_SYSKEYUP)
{
AfxMessageBox("A system key was pressed.");
return true;
}
return false;
}

Chuck
Message 5 of 5
Anonymous
in reply to: Anonymous

I see it now. It was because I was only intercepting the WM_SYSKEYUP
message. I should also have been watching the WM_SYSKEYDOWN message.


"Chuck Gabriel" wrote in message
news:68524A87FE77BB04B703CF91DF435E07@in.WebX.maYIadrTaRb...
> Any idea why the following code does not prevent AutoCAD's menu
accelerators
> from working? Since I return TRUE in the case that the ALT key is
pressed,
> I would expect that the MSG should be terminated and not passed on to
> AutoCAD. However, if I load my arx, run the command that installs the
hook,
> and press ALT-F on the keyboard, AutoCAD's File menu pops up.
>
> BOOL filterKeys(MSG *pMsg)
> {
> if (pMsg->message == WM_SYSKEYUP)
> {
> AfxMessageBox("A system key was pressed.");
> return true;
> }
> return false;
> }
>
> Chuck
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost