Initializes a HardKey object.
Syntax: New1 (FormName As Form, OnlyWhenFormIsActive As Boolean, HardKeys As
Boolean, CursorKeys As Boolean)
FormName - The name of the form which will catch the keys.
OnlyWhenFormIsActive - If set to true then the keys will be caught only when the
specified form is active.
HardKeys - Set to true to catch the five hardware keys.
CursorKeys - Set to true to catch the five cursor keys.
Example:
'Add a reference to the Hardware library and add a HardKey object named
hk.
Sub Globals
End Sub
Sub App_Start
Form1.show
hk.new1("form1",true,true,true) 'Catch the five hardware keys
and the
cursor keys.
End Sub
sub hk_HardKeyPressed
Select hk.KeyPressed
case hk.Key1
msgbox("Key1 was pressed")
case hk.Key2
msgbox("Key2 was pressed")
case hk.Key3
msgbox("Key3 was pressed")
case hk.Key4
msgbox("Key4 was pressed")
case hk.Key5
msgbox("Key5 was pressed")
case hk.KeyLeft
msgbox("Left key was pressed")
case hk.KeyRight
msgbox("Right key was pressed")
case hk.KeyUp
msgbox("Up key was pressed")
case hk.KeyDown
msgbox("Down key was pressed")
case hk.KeyEnter
msgbox("Enter key was pressed")
End Select
end sub