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

Reads the mouse and/or keyboard data sent from a GraphicsWindow, and transmits it down the data graph. More...

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

List of all members.

Public Member Functions

 MouseAndKeyboard (GraphicsWindow window, int device, string name)
int getSourceDevice ()
 Returns the associated source device.
GraphicsWindow getSourceWindow ()
 Returns the associated source window.
 setSource (GraphicsWindow window, int device)
 Redirects the class to get the data from the mouse and keyboard associated with a different window and/or device number.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

Reads the mouse and/or keyboard data sent from a GraphicsWindow, and transmits it down the data graph.

The mouse and keyboard devices are bundled together into one device here, because they interrelate so much. A mouse might be constrained by the holding down of the shift key, for instance, or the clicking of the mouse button might be handled in much the same way as a keyboard key.

Mouse data is sent down the data graph as an x,y position as well as the set of buttons currently being held down; keyboard data is sent down as a set of keypress events in an EventDataTransition. To throw these events to the system, you must attach an EventThrower to the MouseAndKeyboard object; otherwise, the events will be discarded.


Constructor & Destructor Documentation

MouseAndKeyboard ( GraphicsWindow  window,
int  device,
string  name 
)

Member Function Documentation

static TypeHandle getClassType ( ) [static]

Reimplemented from DataNode.

Returns the associated source device.

Returns the associated source window.

setSource ( GraphicsWindow  window,
int  device 
)

Redirects the class to get the data from the mouse and keyboard associated with a different window and/or device number.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties