Platforms to show: All Mac Windows Linux Cross-Platform

This item is deprecated and should no longer be used.
/ComputerControl/Press key/Drag and Drop
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/Drag and Drop
Project "Drag and Drop.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 Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action() mode=mode+1 if mode=2 then p.MouseMove sx,sy end if if mode=3 then p.MouseMoveClick sx,sy,true end if if mode=4 then p.MouseMoveClick sx,sy,False end if if mode=5 then p.MouseMoveClick sx,sy,true end if if mode=6 then p.MouseMoveClick dx,dy,true end if if mode=7 then p.MouseMoveClick dx,dy,false end if if mode=8 then p.MouseMove cx,cy end if if mode=10 then beep mode=1 me.mode=0 end if End EventHandler
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
EventHandler Function KeyDown(Key As String) As Boolean if key="s" then sx=System.MouseX sy=System.Mousey StaticText2.text="source: "+str(sx)+" / "+str(sy) elseif key="d" then dx=System.MouseX dy=System.Mousey StaticText4.text="dest: "+str(dx)+" / "+str(dy) elseif key="r" then cx=System.Mousex cy=System.mousey if mode<=1 then mode=2 Timer1.Mode=2 end if end if End EventHandler
EventHandler Sub Open() p=new PresskeyMBS End EventHandler
Property Protected cx As integer
Property Protected cy As integer
Property Protected dx As integer
Property Protected dy As integer
Property Protected mode As integer
Property Protected p As presskeyMBS
Property Protected sx As integer
Property Protected sy As integer
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

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...