Click to See Complete Forum and Search --> : Trapping shift key strokes


juicemousezero
01-02-2006, 12:30 PM
I'm just trying to trap a stroke of the shift key, but I can't seem to get it to work. I can trap any other given key stroke... G, F, Enter, Space, whatever, but not any of the Shift keys. I've tried all of them. Here's my bit of testing code:


If Asc(e.KeyChar) = Keys.LShiftKey Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.RShiftKey Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.Shift Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.ShiftKey Then
e.Handled = True

ElseIf Asc(e.KeyChar) = Keys.Space Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.Enter Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.F Then
e.Handled = True
End If

juicemousezero
01-02-2006, 01:03 PM
Nevermind. Got it. Wrong event. Silly me.