GraphicsWindowInputDevice
from panda3d.core import GraphicsWindowInputDevice
- class GraphicsWindowInputDevice
Bases:
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
- buttonDown(button: ButtonHandle, time: float)
The following interface is for the various kinds of
GraphicsWindows
to record the data incoming on the device.
- buttonResumeDown(button: ButtonHandle, time: float)
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(button: ButtonHandle, time: float)
Records that the indicated button has been released.
- candidate(candidate_string: str, highlight_start: int, highlight_end: int, cursor_pos: int)
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(time: float)
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 getClassType() TypeHandle
- getPointer() PointerData
Returns the
PointerData
associated with the input device’s pointer. This only makes sense if has_pointer() also returns true.
- pointerMoved(x: float, y: float, time: float)
To be called by a particular kind of
GraphicsWindow
to indicate that the pointer has moved by the given relative amount.
- rawButtonDown(button: ButtonHandle, time: float)
Records that the indicated button has been depressed.
- rawButtonUp(button: ButtonHandle, time: float)
Records that the indicated button has been released.
- removePointer(id: int)
To be called by a particular kind of
GraphicsWindow
to indicate that the pointer no longer exists.
- setPointerInWindow(x: float, y: float, time: float)
To be called by a particular kind of
GraphicsWindow
to indicate that the pointer is within the window, at the given pixel coordinates.
- setPointerOutOfWindow(time: float)
To be called by a particular kind of
GraphicsWindow
to indicate that the pointer is no longer within the window.
- updatePointer(data: PointerData, time: float)
To be called by a particular kind of
GraphicsWindow
to indicate that the pointer data has changed.