#include <graphicsWindowInputDevice.h>
Public Member Functions | |
GraphicsWindowInputDevice () | |
GraphicsWindowInputDevice (const GraphicsWindowInputDevice ©) | |
void | operator= (const GraphicsWindowInputDevice ©) |
~GraphicsWindowInputDevice () | |
string | get_name () const |
bool | has_pointer () const |
bool | has_keyboard () const |
const MouseData & | get_mouse_data () const |
Returns the MouseData associated with the nth input device. | |
bool | has_button_event () const |
Returns true if this device has a pending button event (a mouse button or keyboard button down/up), false otherwise. | |
ButtonEvent | get_button_event () |
Assuming a previous call to has_button_event() returned true, this returns the pending button event. | |
void | button_down (ButtonHandle button) |
Records that the indicated button has been depressed. | |
void | button_resume_down (ButtonHandle button) |
Records that the indicated button was depressed earlier, and we only just detected the event after the fact. | |
void | button_up (ButtonHandle button) |
Records that the indicated button has been released. | |
void | keystroke (int keycode) |
Records that the indicated keystroke has been generated. | |
void | set_pointer_in_window (int x, int y) |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is within the window, at the given pixel coordinates. | |
void | set_pointer_out_of_window () |
To be called by a particular kind of GraphicsWindow to indicate that the pointer is no longer within the window. | |
bool | operator== (const GraphicsWindowInputDevice &other) const |
bool | operator!= (const GraphicsWindowInputDevice &other) const |
bool | operator< (const GraphicsWindowInputDevice &other) const |
Static Public Member Functions | |
GraphicsWindowInputDevice | pointer_only (const string &name) |
This named constructor returns an input device that only has a pointing device, no keyboard. | |
GraphicsWindowInputDevice | keyboard_only (const string &name) |
This named constructor returns an input device that only has a keyboard, no pointing device. | |
GraphicsWindowInputDevice | pointer_and_keyboard (const string &name) |
This named constructor returns an input device that has both a keyboard and pointer. | |
Private Types | |
typedef pdeque< ButtonEvent > | ButtonEvents |
enum | InputDeviceFlags { IDF_has_pointer = 0x01, IDF_has_keyboard = 0x02 } |
Private Member Functions | |
GraphicsWindowInputDevice (const string &name, int flags) | |
Defines a new InputDevice for the window. | |
Private Attributes | |
string | _name |
int | _flags |
MouseData | _mouse_data |
ButtonEvents | _button_events |
Typically this will be a keyboard/mouse pair, and there will be exactly one of these associated with each window, but other variants are possible.
Definition at line 48 of file graphicsWindowInputDevice.h.
|
Definition at line 94 of file graphicsWindowInputDevice.h. |
|
Definition at line 90 of file graphicsWindowInputDevice.h. |
|
Defines a new InputDevice for the window. Most windows will have exactly one InputDevice: a keyboard/mouse pair. Some may also add joystick data, or additional mice or something. This private constructor is only used internally by the named constructors, below. Definition at line 60 of file graphicsWindowInputDevice.cxx. References GraphicsWindowInputDevice(), and IDF_has_pointer. |
|
Definition at line 30 of file graphicsWindowInputDevice.I. Referenced by GraphicsWindowInputDevice(), and pointer_only(). |
|
Definition at line 120 of file graphicsWindowInputDevice.cxx. |
|
Definition at line 151 of file graphicsWindowInputDevice.cxx. References _button_events, and ButtonEvent::T_down. |
|
Records that the indicated button has been depressed.
Definition at line 201 of file graphicsWindowInputDevice.cxx. |
|
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. Definition at line 220 of file graphicsWindowInputDevice.cxx. |
|
Records that the indicated button has been released.
Definition at line 233 of file graphicsWindowInputDevice.cxx. |
|
Assuming a previous call to has_button_event() returned true, this returns the pending button event.
Definition at line 186 of file graphicsWindowInputDevice.cxx. References _button_events. |
|
Returns the MouseData associated with the nth input device.
Definition at line 81 of file graphicsWindowInputDevice.I. References _mouse_data, and y. |
|
Definition at line 42 of file graphicsWindowInputDevice.I. References _flags, IDF_has_pointer, and INLINE. |
|
Returns true if this device has a pending button event (a mouse button or keyboard button down/up), false otherwise. If this returns true, the particular event may be extracted via get_button_event(). Definition at line 171 of file graphicsWindowInputDevice.cxx. References _button_events. |
|
Definition at line 66 of file graphicsWindowInputDevice.I. References _mouse_data. |
|
Definition at line 54 of file graphicsWindowInputDevice.I. References _flags, IDF_has_keyboard, and INLINE. |
|
This named constructor returns an input device that only has a keyboard, no pointing device.
Definition at line 92 of file graphicsWindowInputDevice.cxx. |
|
Records that the indicated keystroke has been generated.
Definition at line 248 of file graphicsWindowInputDevice.cxx. |
|
Definition at line 141 of file graphicsWindowInputDevice.I. |
|
Definition at line 153 of file graphicsWindowInputDevice.I. |
|
Definition at line 136 of file graphicsWindowInputDevice.cxx. |
|
Definition at line 129 of file graphicsWindowInputDevice.I. |
|
This named constructor returns an input device that has both a keyboard and pointer.
Definition at line 107 of file graphicsWindowInputDevice.cxx. References _button_events, _flags, _mouse_data, and _name. |
|
This named constructor returns an input device that only has a pointing device, no keyboard.
Definition at line 77 of file graphicsWindowInputDevice.cxx. References GraphicsWindowInputDevice(), IDF_has_keyboard, and IDF_has_pointer. |
|
To be called by a particular kind of GraphicsWindow to indicate that the pointer is within the window, at the given pixel coordinates.
Definition at line 98 of file graphicsWindowInputDevice.I. References INLINE. |
|
To be called by a particular kind of GraphicsWindow to indicate that the pointer is no longer within the window.
Definition at line 117 of file graphicsWindowInputDevice.I. References INLINE. |
|
Definition at line 99 of file graphicsWindowInputDevice.h. Referenced by get_button_event(), has_button_event(), pointer_and_keyboard(), and ~GraphicsWindowInputDevice(). |
|
Definition at line 97 of file graphicsWindowInputDevice.h. Referenced by get_name(), has_pointer(), and pointer_and_keyboard(). |
|
Definition at line 98 of file graphicsWindowInputDevice.h. Referenced by get_mouse_data(), has_keyboard(), and pointer_and_keyboard(). |
|
Definition at line 96 of file graphicsWindowInputDevice.h. Referenced by GraphicsWindowInputDevice(), and pointer_and_keyboard(). |