Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS ComputerControl Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /ComputerControl/Keycodes
This example is the version from Sun, 17th Mar 2012.
Project "Keycodes.xojo_binary_project"
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action()
dim kVirtualControlKey as integer
if TargetWin32 then
kVirtualControlKey=&h11
else
kVirtualControlKey=&h3B
end if
if m.TestForKeyDown(kVirtualControlKey) then
StaticText7.Visible=true
else
StaticText7.Visible=false
end if
End EventHandler
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
EventHandler Function KeyDown(Key As String) As Boolean
dim c,d as integer
c=asc(key)
d=m.AsciiToKeyCode(c)
StaticText4.text=key
StaticText5.Text=str(d)+" = hex "+hex(d)
StaticText6.text=str(c)+" = hex "+hex(c)
End EventHandler
EventHandler Sub Open()
m=new KeyCodesMBS
StaticText9.text=m.name
End EventHandler
Property Protected m As keyCodesMBS
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project
The items on this page are in the following plugins: MBS ComputerControl Plugin.