MBS Plugin Documentation

Search:

Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchie

New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0

The list of the   themes,   classes,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

PresskeyMBS.Charcode as integer
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: The character you want to press.
Example:
dim p as PresskeyMBS

p=new PresskeyMBS
p.charcode=8
p.keycode=&h33
p.press // press backspace on Mac OS

Notes:
On Mac OS Classic the final printed charcode inside an editfield is the one you pass.
(Read and Write property)
class PresskeyMBS
class, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: This class allows you to simulate keyboard activity.
PresskeyMBS.clear
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Resets this object.
PresskeyMBS.Command as boolean
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Tells the Press method to press down command key before and release it after it simulates the key press.
Example:
p.command=True

Notes:
It looks like the command key is not working for Mac OS Classic.
On Windows the control key is pressed if control or command properties are true.
(Read and Write property)
PresskeyMBS.Control as boolean
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Tells the Press method to press down control key before and release it after it simulates the key press.
Example:
p.Control=True

Notes:
On Windows the control key is pressed if control or command properties are true.
(Read and Write property)
PresskeyMBS.Keycode as integer
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: For Mac OS the number of the key on the keyboard which is pressed.
Example:
dim p as PresskeyMBS
p=new PresskeyMBS
p.keycode=2
p.charcode="d"
p.press 'shows a "d" on Mac OS

Notes:
You find this codes in that nice tables for the codes of the Spritesurface in the Realbasic books.
(Read and Write property)
PresskeyMBS.Lasterror as integer
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Plugin version: 3.3, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: The last error code.
Notes:
Not all functions of this class fill this property!
(Read and Write property)
PresskeyMBS.mouseclick(down as boolean)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Clicks the mouse button.
Example:
none.

Notes:
Clicks the mouse at current position.
Left button is used.
If you forget the mouseup you may loose control about a Mac with Mac OS X, but if you have enabled external terminal login you can login via SSH and quit Realbasic from outside.

The Mac version sets the lasterror property.
PresskeyMBS.MouseClick(down as boolean, rightdown as boolean)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Plugin version: 8.1, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Clicks the mouse with the given buttons.
Notes: Same as MouseClick, but with an additional rightdown parameter.
PresskeyMBS.MouseMove(globalx as integer,globaly as integer)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Moves the mouse.
Example:
dim x,y as integer
dim p as PresskeyMBS
p=new PresskeyMBS
x=system.mousex
y=system.mousey+10 // move ten pixels down
p.mousemove x,y

Notes:
Moves the mouse on screen.
The destination must be specified in global screen coordinates.
Requires Mac OS 8.5 or newer for Mac OS Classic.
PresskeyMBS.MouseMoveClick(globalx as integer,globaly as integer,down as boolean)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Plugin version: 2.8, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Moves the mouse.
Notes:
Moves the mouse on screen and clicks.
The destination must be specified in global screen coordinates.
Requires Mac OS 8.5 or newer for Mac OS Classic.

The Mac version sets the lasterror property.

Mac OS X only:
Based on the values entered, the appropriate mouse-down, mouse-up, mouse-move, or mouse-drag events are generated, by comparing the new state with the current state.
PresskeyMBS.MouseMoveClick(globalx as integer,globaly as integer,down as boolean, rightdown as boolean)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Plugin version: 8.1, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Moves the mouse cursor and clicks the mouse with the given buttons.
Notes: Same as MouseMoveClick, but with an additional rightdown parameter.
PresskeyMBS.Option as boolean
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Tells the Press method to press down option key before and release it after it simulates the key press.
Example:
p.option=True

Notes: (Read and Write property)
PresskeyMBS.press
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Presses a key.
Example:
' example for Mac OS X:
dim p as PresskeyMBS

p=new PresskeyMBS
p.shift=true
p.charcode=asc("H")
p.keycode=4
p.press 'press H
p.shift=false
p.charcode=asc("e")
p.keycode=14
p.press 'press e
p.charcode=asc("l")
p.keycode=37
p.press 'press l
p.press 'press l
p.charcode=asc("o")
p.keycode=31
p.press 'press o

' example for Windows:

dim p as PresskeyMBS

editfield1.setfocus 'so we get something in it!

p=new PresskeyMBS
p.shift=true
p.charcode=asc("H")
p.virtualCode=-1 'automatically try to get this code
p.press 'press H
p.shift=false
p.virtualCode=-1 'after a call you find the virtualCode there
p.charcode=asc("e")
p.press 'press e
p.virtualCode=-1
p.charcode=asc("l")
p.press 'press l
p.press 'press l
p.virtualCode=-1
p.charcode=asc("o")
p.press 'press o

Notes:
Simulates a keypress and handles the Settings for Shift, Control, Command and Option key.
Command shows no reaction in my tests for Mac OS Classic
On Windows, if you set virtualcode=-1 this method will set it to the code matching the charcode property.

The Mac version sets the lasterror property.
PresskeyMBS.pressraw(down as boolean)
method, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Presses a key.
Example:
' Works perfectly on Mac OS X but Shift can't be done Raw on Mac OS 9:
dim p as PresskeyMBS

p=new PresskeyMBS

p.charcode=0
p.keycode=&h38
p.pressraw true 'shift down

p.charcode=asc("H")
p.keycode=4
p.pressraw true 'press H
p.pressraw false

p.charcode=0
p.keycode=&h38
p.pressraw false 'shift up

p.charcode=asc("e")
p.keycode=14
p.pressraw true 'press e
p.pressraw false
p.charcode=asc("l")
p.keycode=37
p.pressraw true 'press l
p.pressraw false
p.pressraw true 'press l
p.pressraw false
p.charcode=asc("o")
p.keycode=31
p.pressraw true 'press o
p.pressraw false

Notes:
Simulates a keypress and doesn't handle the Settings for Shift, Control, Command and Option key.
On Windows, if you set virtualcode=-1 this method will set it to the code matching the charcode property.

The Mac version sets the lasterror property.
PresskeyMBS.Shift as boolean
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: Tells the Press method to press down shift before and release it after it simulates the key press.
Example:
dim p as PresskeyMBS

p=new PresskeyMBS
p.shift=true
p.charcode=asc("1")
p.keycode=18
p.press 'press !


Notes: (Read and Write property)
PresskeyMBS.VirtualCode as integer
property, Remote Control, MBS ComputerControl Plugin (Presskey), class PresskeyMBS, Mac OS X: Works, Windows: Works, Linux x86: Does nothing, Feedback.

Function: The virtual keycode to press.
Example:
dim p as PresskeyMBS
p=new PresskeyMBS
p.charcode="m"
p.virtualcode=-1
p.press ' makes a "m" on Windows.

Notes:
If you don't know this code, just pass -1 and this value will be filled automatically using the charcode property.
After you call press or pressraw you'll find the matching virtualcode in this property.
(Read and Write property)

Next items

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