Shoutbox

[?] WM_KEYUP - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] WM_KEYUP (/showthread.php?tid=85182)

[?] WM_KEYUP by Spunky on 08-04-2008 at 02:43 PM

Has anyone got the decimal or hex number I need to register the notification of the KeyUp Event? I couldn't get it to work so I tested it with WM_PAINT (5) and it was working fine.

I even set up a loop from 0 to 400 and tried seeing which ones were triggered on key press, but with no luck.


RE: [?] WM_KEYUP by mynetx on 08-04-2008 at 02:48 PM

code:
var WM_KEYUP =257;

RE: [?] WM_KEYUP by foaly on 08-04-2008 at 02:49 PM

WM_KEYUP 257 // 0x0101


RE: [?] WM_KEYUP by Spunky on 08-04-2008 at 02:50 PM

I did try 257 (0x101), but it didn't seem to work. I'm trying to detect arrow key press though, would it be the same message?

EDIT: 1900th Post :p


RE: [?] WM_KEYUP by matty on 08-04-2008 at 02:53 PM

WM_KEYUP is 0x101

http://msdn.microsoft.com/en-us/library/ms646281(VS.85).aspx

WPARAM contains the virtual key that is pressed.


RE: [?] WM_KEYUP by Spunky on 08-04-2008 at 02:55 PM

Ok, I'll have to give it another try when I get home from work


RE: [?] WM_KEYUP by roflmao456 on 08-04-2008 at 03:45 PM

http://www.groupsrv.com/dotnet/about52848.html
;)

0x101 doesn't work for me either. nothing comes up in the debug


RE: [?] WM_KEYUP by Mnjul on 08-04-2008 at 03:48 PM

Well, I am not sure (and could possibly be wrong!), but does your window you register for message notification has a child window (such as a control like a textbox) focused? I remember in this situation, the window itself won't process/receive WM_KEYUP.


RE: [?] WM_KEYUP by Spunky on 08-04-2008 at 04:06 PM

I'm not using a child window, I don't know about roflmao though


RE: [?] WM_KEYUP by effection on 08-04-2008 at 05:38 PM

the arrow keys are system keys afaik so you need the system key up message which i cant remember right now


RE: [?] WM_KEYUP by Mnjul on 08-04-2008 at 05:52 PM

quote:
Originally posted by SpunkyLoveMuff
I'm not using a child window, I don't know about roflmao though
Hmm, look at  WM_SYSKEUP Notification (), it's interesting:
quote:
WM_SYSKEYUP Notification

The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.


You might give it a try :p, I don't know if it works; I believe I have successfully intercepted WM_KEYUP with arrow keys when I coded some WndProc in C, like some years ago.
RE: [?] WM_KEYUP by Spunky on 08-05-2008 at 08:47 PM

No joy yet...

quote:
Originally posted by Debug

Script has been stopped           
Script is starting                   
Script is now loaded and ready       

Message: wParam - lParam
                                   
274: 61458 - 25887288               
273: 8146 - 263166             
273: 8146 - 263166             
274: 61696 - 0                     
278: 9241369 - 0               
287: 546308096 - 9241369       
289: 2 - 0                             
289: 2 - 0                         
287: -65536 - 0                     



I registered every message from 200-300 and these are the only messages that showed.

274 is me clicking the window
273 is sent on either pressing SPACE or RETURN
274 - 289 is ALT
289 - 287 is ALT again


RE: [?] WM_KEYUP by CookieRevised on 08-05-2008 at 11:09 PM

quote:
Originally posted by Mnjul
Well, I am not sure (and could possibly be wrong!), but does your window you register for message notification has a child window (such as a control like a textbox) focused? I remember in this situation, the window itself won't process/receive WM_KEYUP.
nope, you're not wrong...

The WM_KEYUP message (and the likes) is send to the control, not to the window which you subclassed with PlusWnd::RegisterMessageNotification.

If you want to catch this message you would need to subclass the control, not the parent window.....
RE: [?] WM_KEYUP by matty on 08-06-2008 at 03:33 AM

You can also try Registering these keys as hotkeys and unregistering them when the window loses the focus.