borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Windows Authenication)Next Topic (function returning server name) New Topic New Poll Post Reply
AndreaVB Forum : API : Options For Grabbing Input
Poster Message
goldenaura3
Level: Trainee

Registered: 28-05-2005
Posts: 3

icon Options For Grabbing Input

Howdy, everyone.

I've got a quick question about getting keyboard input. What I'm trying to do is wait for a user to press a key, then have a method return which key was pressed. I understand it's possible to do so by creating an switch statment with each key, but are there easier options?

Here's what I've tried:

crtdll/_getch
  May be shell based. Always returns -1 in the program.

user32/GetAsyncKeyState
user32/GetKeyState
  It works, but I'm curious to see if there is a method to automaticly return which key was pressed.

Thanks muchly for any info.

28-05-2005 at 01:59 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Options For Grabbing Input

I dont understand why you are not satisfied with GetKeyState API? Hook to keyboard on WH_KEYBOARD (or WH_KEYBOARD_LL) message, and all messages will be sent to KeyboardProc.

____________________________
If you find the answer helpful, please mark this topic as solved.

28-05-2005 at 04:06 PM
View Profile Send Email to User Show All Posts | Quote Reply
goldenaura3
Level: Trainee

Registered: 28-05-2005
Posts: 3
icon Re: Options For Grabbing Input

Thanks again, Goran.

I think I found exactly what I'm looking for. Since I'm monitering all the keys, I think GetKeyboardState will do fine.

28-05-2005 at 07:16 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : API : Options For Grabbing Input
Previous Topic (Windows Authenication)Next Topic (function returning server name) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder