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 / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

WH_Keyboard

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yehia A.Salam - 05 Oct 2007 23:05 GMT
Hello,

Why does the WH_Keyboard hook intercept all keys as capital letters? for
example when I type "a" I get a 65 keycode (Virtual Key Code for A) in the
wParam of the filter function though I should have got 97 (Virtual Key Code
for a)

Thanks
Yehia A.Salam
Mattias Sjögren - 06 Oct 2007 09:36 GMT
>Why does the WH_Keyboard hook intercept all keys as capital letters? for
>example when I type "a" I get a 65 keycode (Virtual Key Code for A) in the
>wParam of the filter function though I should have got 97 (Virtual Key Code
>for a)

Virtual key codes represent keys, not letters. There is only one code
(65, 0x41) representing pressing the A key on the keyboard, whether it
will turn into a capital letter or not. The code 97 (0x61) is
VK_NUMPAD1, it has nothing to do with the A key. I think you're
confusing virtual key codes with ASCII character codes.

To differentiate between small and capital letters you'll have to
check the state of the Shift and Caps Lock keys, or listen to WM_CHAR
messages instead of keyboard messages.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Rate this thread:







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.