Platforms to show: All Mac Windows Linux Cross-Platform

This item is deprecated and should no longer be used.
/ComputerControl/Press key/MouseMover
Function:
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/Press key/MouseMover
Project "MouseMover.xojo_binary_project"
Class Fenster1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
EventHandler Function MouseDown(X As Integer, Y As Integer) As Boolean beep me.refresh End EventHandler
EventHandler Sub MouseEnter() inside=true End EventHandler
EventHandler Sub MouseExit() inside=false End EventHandler
EventHandler Sub Paint(g As Graphics) g.foreColor=rgb(rnd*256,rnd*256,rnd*256) g.fillrect 0,0,g.width,g.height End EventHandler
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 MouseUpTimer Inherits Timer
ControlInstance MouseUpTimer Inherits Timer
EventHandler Sub Action() dim p as PresskeyMBS p=new PresskeyMBS p.MouseClick true p.MouseClick false End EventHandler
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
EventHandler Function KeyDown(Key As String) As Boolean dim x,y as integer dim p as PresskeyMBS StaticText6.text=str(asc(key)) if asc(key)=28 then // cursor left p=new PresskeyMBS x=system.mouseX y=system.mousey x=x-10 p.Mousemove x,y return true end if if asc(key)=29 then // cursor right p=new PresskeyMBS x=system.mouseX y=system.mousey x=x+10 p.Mousemove x,y return true end if if asc(key)=30 then // cursor up p=new PresskeyMBS x=system.mouseX y=system.mousey y=y-10 p.Mousemove x,y return true end if if asc(key)=31 then // cursor down p=new PresskeyMBS x=system.mouseX y=system.mousey y=y+10 p.Mousemove x,y return true end if if asc(key)=27 then // center on escape p=new PresskeyMBS x=screen(0).width/2 y=screen(0).height/2 p.Mousemove x,y return true end if if asc(key)=32 then // click on space if MouseUpTimer.mode=0 then MouseUpTimer.mode=1 // mouseup after mousedown return true end if end if End EventHandler
Property inside As boolean
End Class
MenuBar Menü
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "Ablage"
MenuItem FileQuit = "Beenden"
MenuItem UntitledMenu0 = "Bearbeiten"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Ausschneiden"
MenuItem EditCopy = "Kopieren"
MenuItem EditPaste = "Einfügen"
MenuItem EditClear = "Löschen"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

The items on this page are in the following plugins: MBS ComputerControl Plugin.

Feedback: Report problem or ask question.

The biggest plugin in space...