.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Listen for escape pressed
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
206 Views, 4 Replies
01-04-2013 02:57 AM
Hi
Is there a way to add a listener so I am told when escape(cancel command) is pressed? I want to create a cancel pressed event.
Solved! Go to Solution.
Re: Listen for escape pressed
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-04-2013 08:24 AM in reply to:
Fredrik.Larsen
This way can help you:
How to implement a Windows Hook using acedRegisterFilterWinMsg in .NETIn WindowHookProc event handler you can check msg.Msg == WM_KEYDOWN (0x0100) and msg.WParam == VK_ESCAPE (0x1B)
Re: Listen for escape pressed
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-07-2013 12:58 AM in reply to:
Alexander.Rivilis
Thanks, that seems to work, but how do you unregister the listener? When escape is pressed I want to do something and then unregister the listener.
Re: Listen for escape pressed
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-07-2013 02:36 AM in reply to:
Fredrik.Larsen
In order to unregister this event handler use function acedRemoveFilterWinMsg:
BOOL acedRemoveFilterWinMsg(
const AcedFilterWinMsgFn pfn
);
In C# it is look like:
// For AutoCAD 2013 64 bit
// On previous versions, import from acad.exe (instead accore.dll)
[DllImport("accore.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedRemoveFilterWinMsg@@YAHQ6AHPEAUtagMSG@@@Z@Z" )]
private static extern int acedRemoveFilterWinMsg( WindowHookProc callBackFunc );
Re: Listen for escape pressed
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-07-2013 03:11 AM in reply to:
Alexander.Rivilis
Thank you very much.




