|
-
Aug 20th, 2008, 09:09 AM
#1
Thread Starter
Lively Member
[RESOLVED] how to capture multiple key strokes at once
anyone know a way to capture multiple key strokes when a form is open? when a form is open and the user presses a combination of keys at the same time (ie cntrl+j) i want an event to fire. (much like when you hit cntrl+alt+del in windows)
microsoft access 2003
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
-
Aug 20th, 2008, 09:23 AM
#2
Hyperactive Member
Re: how to capture multiple key strokes at once
Set it up as a hot key in your menu? Then you can do what you want with it.
Slower than a crippled Vista
More buggy than a fresh XP install
Look! Down the road, some 50 miles behind the drunken snail.
It's Ubuntu!
-
Aug 20th, 2008, 10:01 AM
#3
Thread Starter
Lively Member
Re: how to capture multiple key strokes at once
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
-
Aug 20th, 2008, 11:38 AM
#4
Thread Starter
Lively Member
Re: how to capture multiple key strokes at once
this seems to work. found this here:
If (KeyAscii And 2) And (KeyAscii = Asc("J")) Then
KeyAscii = 0
MsgBox "ok"
End If
nevermind, that just checks for a capital leter
Last edited by dreamdelerium; Aug 20th, 2008 at 11:53 AM.
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
-
Aug 20th, 2008, 01:25 PM
#5
Re: how to capture multiple key strokes at once
Are you doing this in a sheet or a UserForm?
-
Aug 20th, 2008, 01:50 PM
#6
Thread Starter
Lively Member
Re: how to capture multiple key strokes at once
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
-
Aug 21st, 2008, 07:18 AM
#7
Thread Starter
Lively Member
Re: how to capture multiple key strokes at once
well, finally got it:
the keydown event for the form:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
HandleKeys KeyCode, Shift
End Sub
call this function:
Code:
Public Sub HandleKeys(KeyCode As Integer, Shift As Integer)
Dim ShiftDown As Integer
Const KEY_j = 74
Const CTRL_MASK = 2
ShiftDown = ((Shift And CTRL_MASK) > 0)
Select Case KeyCode
Case KEY_j
If ShiftDown = -1 Then
'do whatever here
Else
End If
End Select
KeyCode = 0
End Sub
Last edited by dreamdelerium; Aug 21st, 2008 at 07:22 AM.
I am using Microsoft Visual Basic 2008 Express Edition. I use Access for my data base
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
|