• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Keyboard Input

I wanna know how to scan the keyboard input for certain chars ( like scanning the keyb buffer... ) and how to get the codes for the keys being pressed.

The program is gonna be runnin in the system tray and will scan for certain keys being pressed.

Thx
0
maximebrunet
Asked:
maximebrunet
1 Solution
 
deightonCommented:
Her's how to get the key pressed


     Private Declare Function GetAsyncKeyState Lib "user32" _
 (ByVal vKey As Long) As Integer



      Public Sub getKey()
           
         
      Do
      DoEvents

       bNone = False
       For x = 1 To 255
        Key_State_Number = GetAsyncKeyState(x)
         
         If x = iold And Key_State_Number = 0 Then iold = 0
           
         If Key_State_Number <> 0 And iold <> x Then
         
         
          KeyState = x
          Debug.Print iold, x
          iold = x
         
         End If
 
         
       Next
       
      Loop
      End Sub

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now