Computer Science Canada Disabling/Enabling Hotkeys |
Author: | DaisukeShiiro [ Mon Dec 21, 2009 12:39 am ] |
Post subject: | Disabling/Enabling Hotkeys |
Hello World! As you can tell by my 1 posts that I'm new here and to VB. Due to my school's cheapness, my school stopped using VB 6.0 and switched to the free VB Express, so I'm just hoping that this would work x.x Me and my partner are making a jeopardy program, and due to my partner's stubbornness of instead of making it 1 player Vs 2 computer, we'd have to make it 3 players, where each player would have a hotkey to buzz in. This is what I have so far; Dim counter As Integer = 0 Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Select Case e.KeyData Case Keys.L Timer1.Enabled = True counter = 0 Case Keys.D Timer1.Enabled = True End Select End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick counter += 1 If counter = 15 Then Timer1.Enabled = False MessageBox.Show("Time's up") End If End Sub It's just a bit of a rough outline, but my question is, how to disable the hotkeys when someone presses their hotkey o.o Please and thank you. Even though I'm using VB Express, I'm sure that VB Express and VB6 are very close, so inputs in VB6 is still kindly appreciated. |