Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Distinguish Home key from NumPad Home key?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Lin - 27 Sep 2004 17:06 GMT
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
Claes Bergefall - 28 Sep 2004 08:58 GMT
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

> Hi all,
>     Does anyone know if it is possible to distinguish between a user
[quoted text clipped - 11 lines]
>     Thanks,
>         Jim
Jim Lin - 28 Sep 2004 15:53 GMT
Many thanks, Claes!  It works for me now  :)

   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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.