c# - Wrong WParam value in IMessageFilter.PreFilterMessage -
i in process implement application-wide keyboard hook 1 of applications.
done using imessagefilter
implementation overriding prefiltermessage
method , adding imessagefilter
main form.
far able test, of number , letter keys work without problem, when comes to, let's say, keys.left
(code 37), wparam
of message
contains a, seems, wrong value (code 39).
, yes, did bit-and keys.keycode
(which 65535 btw. means wouldn't matter).
if has idea or hint why works letter/number keys not keys.left
highly appreciate that.
code:
public bool prefiltermessage(ref message m) { if(m.msg == wm_keydown) { _keytable[(keys)m.wparam & keys.keycode] = true; } if(m.msg == wm_keyup) { _keytable[(keys)m.wparam & keys.keycode] = false; } return false; }
Comments
Post a Comment