GraphicsWindowInputDevice

class GraphicsWindowInputDevice

Bases: InputDevice

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.

Inheritance diagram

Inheritance diagram of GraphicsWindowInputDevice

void button_down(ButtonHandle button, double time = ClockObject::get_global_clock()->get_frame_time())

The following interface is for the various kinds of GraphicsWindows to record the data incoming on the device.

Records that the indicated button has been depressed.

void button_resume_down(ButtonHandle button, double time = ClockObject::get_global_clock()->get_frame_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.

void button_up(ButtonHandle button, double time = ClockObject::get_global_clock()->get_frame_time())

Records that the indicated button has been released.

void candidate(std::wstring const &candidate_string, std::size_t highlight_start, std::size_t highlight_end, std::size_t 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.

void focus_lost(double time = ClockObject::get_global_clock()->get_frame_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 TypeHandle get_class_type(void)
PointerData get_pointer(void) const

Returns the PointerData associated with the input device’s pointer. This only makes sense if has_pointer() also returns true.

void keystroke(int keycode, double time = ClockObject::get_global_clock()->get_frame_time())

Records that the indicated keystroke has been generated.

void pointer_moved(double x, double y, double time = ClockObject::get_global_clock()->get_frame_time())

To be called by a particular kind of GraphicsWindow to indicate that the pointer has moved by the given relative amount.

void raw_button_down(ButtonHandle button, double time = ClockObject::get_global_clock()->get_frame_time())

Records that the indicated button has been depressed.

void raw_button_up(ButtonHandle button, double time = ClockObject::get_global_clock()->get_frame_time())

Records that the indicated button has been released.

void remove_pointer(int id)

To be called by a particular kind of GraphicsWindow to indicate that the pointer no longer exists.

void set_pointer_in_window(double x, double y, double time = ClockObject::get_global_clock()->get_frame_time())

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(double time = ClockObject::get_global_clock()->get_frame_time())

To be called by a particular kind of GraphicsWindow to indicate that the pointer is no longer within the window.

void update_pointer(PointerData data, double time = ClockObject::get_global_clock()->get_frame_time())

To be called by a particular kind of GraphicsWindow to indicate that the pointer data has changed.