Panda3D
|
This is a virtual input device that represents the keyboard and mouse pair that is associated with a particular window. More...
#include <pandadoc.hpp>
Public Member Functions | |
buttonDown (ButtonHandle button, double time) | |
buttonResumeDown (ButtonHandle button, double time) | |
Records that the indicated button was depressed earlier, and we only just detected the event after the fact. | |
buttonUp (ButtonHandle button, double time) | |
Records that the indicated button has been released. | |
candidate (str candidate_string, int highlight_start, int highlight_end, int cursor_pos) | |
Records that the indicated candidate string has been highlighted. | |
focusLost (double time) | |
This should be called when the window focus is lost, so that we may miss upcoming button events (especially "up" events) for the next period of time. | |
PointerData | getPointer () |
Returns the PointerData associated with the input device's pointer. | |
keystroke (int keycode, double time) | |
Records that the indicated keystroke has been generated. | |
pointerMoved (double x, double y, double time) | |
To be called by a particular kind of GraphicsWindow to indicate that the pointer has moved by the given relative amount. | |
rawButtonDown (ButtonHandle button, double time) | |
Records that the indicated button has been depressed. | |
rawButtonUp (ButtonHandle button, double time) | |
Records that the indicated button has been released. | |
removePointer (int id) | |
To be called by a particular kind of GraphicsWindow to indicate that the pointer no longer exists. | |
setPointerInWindow (double x, double y, double time) | |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is within the window, at the given pixel coordinates. | |
setPointerOutOfWindow (double time) | |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is no longer within the window. | |
updatePointer (PointerData data, double time) | |
To be called by a particular kind of GraphicsWindow to indicate that the pointer data has changed. | |
![]() | |
disablePointerEvents () | |
Disables the generation of mouse-movement events. | |
enablePointerEvents () | |
Enables the generation of mouse-movement events. | |
InputDevice::AxisState | findAxis (InputDevice::Axis axis) |
Returns the first AnalogAxis found with the given axis, or throw an assert if the axis was not found in the list. | |
InputDevice::ButtonState | findButton (ButtonHandle handle) |
Returns the first ButtonState found with the given axis, or throw an assert if the button handle was not found in the list. | |
ButtonEventList | getButtonEvents () |
Returns the list of recently-generated ButtonEvents. | |
PointerEventList | getPointerEvents () |
Returns a PointerEventList containing all the recent pointer events. | |
bool | hasButtonEvent () |
Returns true if this device has a pending button event (a mouse button or keyboard button down/up), false otherwise. | |
bool | hasFeature (InputDevice::Feature feature) |
Returns true if the device supports the indicated feature. | |
bool | hasPointerEvent () |
Returns true if this device has a pending pointer event (a mouse movement), or false otherwise. | |
mapAxis (int index, InputDevice::Axis axis) | |
Associates the indicated Axis with the axis of the indicated index number. | |
mapButton (int index, ButtonHandle handle) | |
Associates the indicated ButtonHandle with the button of the indicated index number. | |
output (Ostream out) | |
Writes a one-line string describing the device. | |
poll () | |
Polls the input device for new activity, to ensure it contains the latest events. | |
setVibration (double strong, double weak) | |
Sets the strength of the vibration effect, if supported. | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
![]() | |
int | getRefCount () |
Returns the current reference count. | |
ref () | |
Explicitly increments the reference count. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | unref () |
Explicitly decrements the reference count. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Additional Inherited Members | |
![]() | |
enum | Axis { none = 0 , x = 1 , y = 2 , z = 3 , yaw = 4 , pitch = 5 , roll = 6 , left_x = 7 , left_y = 8 , left_trigger = 9 , right_x = 10 , right_y = 11 , right_trigger = 12 , throttle = 13 , rudder = 14 , wheel = 15 , accelerator = 16 , brake = 17 , pressure = 18 } |
enum | DeviceClass { unknown = 0 , virtual_device = 1 , keyboard = 2 , mouse = 3 , touch = 4 , gamepad = 5 , flight_stick = 6 , steering_wheel = 7 , dance_pad = 8 , hmd = 9 , spatial_mouse = 10 , digitizer = 11 } |
enum | Feature { pointer = 0 , keyboard = 2 , tracker = 2 , vibration = 3 , battery = 4 } |
enum | State { S_unknown = 0 , S_up = 1 , S_down = 2 } |
![]() | |
InputDevice::Axes | _axes |
InputDevice::BatteryData | _battery_data |
InputDevice::Buttons | _buttons |
PointerData | _pointer_data |
TrackerData | _tracker_data |
InputDevice::AxisState | axes [] |
Returns the axis state that is set at the given index, or throw an assert if the index was not found in the list. | |
InputDevice::BatteryData | battery |
Returns a rough indication of the battery level, ranging from 0 (completely empty battery) to the indicated max_level value. | |
InputDevice::ButtonState | buttons [] |
Make device buttons and axes iterable. | |
bool | connected |
This is false if we know that the device is not currently connected. May report false positives if we can't know this with certainty. | |
InputDevice::DeviceClass | device_class |
This contains an identification of the general type of device. If this could not be determined, it is set to DC_unknown. | |
String | manufacturer |
The device's manufacturer, or the empty string if not known. | |
String | name |
The human-readable name of this input device. | |
unsigned short int | product_id |
USB product ID of the device, or 0 if not known. | |
String | serial_number |
The device's serial number, or the empty string if not known. | |
TrackerData | tracker |
Getters for the various types of device data. | |
unsigned short int | vendor_id |
USB vendor ID of the device, or 0 if not known. | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. | |
![]() | |
int | ref_count |
The current reference count. | |
This is a virtual input device that represents the keyboard and mouse pair that is associated with a particular window.
It collects mouse and keyboard events from the windowing system while the window is in focus.
buttonDown | ( | ButtonHandle | button, |
double | time ) |
buttonResumeDown | ( | ButtonHandle | button, |
double | time ) |
Records that the indicated button was depressed earlier, and we only just detected the event after the fact.
This is mainly useful for tracking the state of modifier keys.
buttonUp | ( | ButtonHandle | button, |
double | time ) |
Records that the indicated button has been released.
candidate | ( | str | candidate_string, |
int | highlight_start, | ||
int | highlight_end, | ||
int | cursor_pos ) |
Records that the indicated candidate string has been highlighted.
This is used to implement IME support for typing in international languages, especially Chinese/Japanese/Korean.
focusLost | ( | double | time | ) |
This should be called when the window focus is lost, so that we may miss upcoming button events (especially "up" events) for the next period of time.
It generates keyboard and mouse "up" events for those buttons that we previously sent unpaired "down" events, so that the Panda application will believe all buttons are now released.
|
static |
PointerData getPointer | ( | ) |
Returns the PointerData associated with the input device's pointer.
This only makes sense if has_pointer() also returns true.
keystroke | ( | int | keycode, |
double | time ) |
Records that the indicated keystroke has been generated.
pointerMoved | ( | double | x, |
double | y, | ||
double | time ) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer has moved by the given relative amount.
rawButtonDown | ( | ButtonHandle | button, |
double | time ) |
Records that the indicated button has been depressed.
rawButtonUp | ( | ButtonHandle | button, |
double | time ) |
Records that the indicated button has been released.
removePointer | ( | int | id | ) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer no longer exists.
setPointerInWindow | ( | double | x, |
double | y, | ||
double | time ) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is within the window, at the given pixel coordinates.
setPointerOutOfWindow | ( | double | time | ) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is no longer within the window.
updatePointer | ( | PointerData | data, |
double | time ) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer data has changed.