|
-
Jan 9th, 2002, 06:16 AM
#1
Thread Starter
Hyperactive Member
Catching keystrokes
hi everybody
I want my project form to react to combination of some keystrokes like 'shift+R' or 'ctrl+shift+P' and display respective forms.
How can i catch the combination of keys because keypress or keydown can store only one keystroke.
Thanks in advance
-
Jan 9th, 2002, 06:41 AM
#2
Hyperactive Member
You can create a hook with sethookex on keyboard_LL or something. I'm on another computer tight now, so I can't look it up 4 you. So I don't know the exact names of the functions. You should have a look in MSDN 4 the function sethookex or setwindowhookex.
-
Jan 11th, 2002, 05:20 AM
#3
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Dim i
Private Sub SendKeys_Timer()
For i = 1 To 255
key = 0
key = GetAsyncKeyState(i)
If key <> 0 Then
txtkeys.text = txtkeys.text & Chr(i)
End If
Next
End Sub
-
Jan 11th, 2002, 05:24 AM
#4
Frenzied Member
Check out the MCL Hotkey control
To use this, drop the control on your form and set the properties:
AltKey = False
ShiftKey = True
VKey = vbKeyP
WinKey = False
Then whenever the keypress combination is pressed whether your application has the focus or not the HotkeyPressed event will fire.
HTH,
Duncan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|