Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
VirtualMouse Class Reference

Poses as a MouseAndKeyboard object in the datagraph, but accepts input from user calls, rather than reading the actual mouse and keyboard from an input device. More...

Inheritance diagram for VirtualMouse:
DataNode PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject

List of all members.

Public Member Functions

 VirtualMouse (string name)
 pressButton (ButtonHandle button)
 Simulates a mouse or keyboard button being depressed.
 releaseButton (ButtonHandle button)
 Simulates the button being released.
 setMouseOn (bool flag)
 Sets whether the mouse should appear to be within the window or not.
 setMousePos (int x, int y)
 Sets the current mouse pixel location, where (0,0) is the upper left, and (width-1, height-1) is the lower right pixel of the virtual window.
 setWindowSize (int width, int height)
 Sets the size of the "window" in which the mouse rolls.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

Poses as a MouseAndKeyboard object in the datagraph, but accepts input from user calls, rather than reading the actual mouse and keyboard from an input device.

The user can write high-level code to put the mouse wherever he/she wants, and to insert keypresses on demand.


Constructor & Destructor Documentation

VirtualMouse ( string  name)

Member Function Documentation

static TypeHandle getClassType ( ) [static]

Reimplemented from DataNode.

Simulates a mouse or keyboard button being depressed.

This should be followed up by a call to release_button() sometime later (possibly immediately).

Simulates the button being released.

This should follow a previous call to press_button().

setMouseOn ( bool  flag)

Sets whether the mouse should appear to be within the window or not.

If this is true, the mouse is within the window; if false, the mouse is not within the window (and set_mouse_pos() means nothing).

setMousePos ( int  x,
int  y 
)

Sets the current mouse pixel location, where (0,0) is the upper left, and (width-1, height-1) is the lower right pixel of the virtual window.

setWindowSize ( int  width,
int  height 
)

Sets the size of the "window" in which the mouse rolls.

This changes the meaning of the values passed to set_mouse_pos().

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties