Started by G_G, March 08, 2009, 11:52:53 am
'INKEY.BAS - how to use the Inkey$ variable open "Inkey$ example" for graphics as #graph print #graph, "when characterInput [fetch]"[mainLoop] print #graph, "setfocus" input r$[fetch] 'a character was typed! key$ = Inkey$ if len(key$) = 1 then notice key$+" was pressed!" else keyValue = asc(right$(key$, 1)) if keyValue = _VK_SHIFT then notice "Shift was pressed" else if keyValue = _VK_CONTROL then notice "Ctrl was pressed" else notice "Unhandled key pressed" end if end if end if goto [mainLoop]
Private Sub Map_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown Select Case e.KeyCode Case Keys.Left Label1.Text = Val(Label1.Text) - 2 PictureBox1.Location = New System.Drawing.Point(Val(Label1.Text), Val(Label2.Text)) Case Keys.Right Label1.Text = Val(Label1.Text) + 2 PictureBox1.Location = New System.Drawing.Point(Val(Label1.Text), Val(Label2.Text)) Case Keys.Up Label2.Text = Val(Label2.Text) - 2 PictureBox1.Location = New System.Drawing.Point(Val(Label1.Text), Val(Label2.Text)) Case Keys.Down Label2.Text = Val(Label2.Text) + 2 PictureBox1.Location = New System.Drawing.Point(Val(Label1.Text), Val(Label2.Text)) Case Keys.X Stats.Show() Me.Close() End Select End Sub