Distinguish Home key from NumPad Home key?

  • Thread starter Thread starter Jim Lin
  • Start date Start date
J

Jim Lin

Hi all,
Does anyone know if it is possible to distinguish between a user
pressing the dedicated Home key versus the Home key on the number pad
(NumPad 7 with NumLock off)? I'm working in VB.NET on WinXP Pro. The
standard KeyPress/Down/Up events return identical key codes. I've tried the
API GetKeyboardState call and I've even tried keyboard hooks as described in
http://www.developer.com/net/net/article.php/11087_2193301_1/

I'm able to accurately determine state of the NumLock key, but NumPad 7 with
the NumLock off appears to generate the same key code as the dedicated Home
key. Has anyone had any experience in this area? I've been looking at this
issue for a while, so it's possible I'm overlooking something simple :)

Thanks,
Jim
 
Handle WM_KEYDOWN and check the extended-key flag (bit
24 in the lParam parameter). It is 0 for the Home key on the number
pad and 1 for the other one

/claes
 
Back
Top