ButtonEvent
from panda3d.core import ButtonEvent
- class ButtonEvent
Bases:
DTOOL_SUPER_BASE
Records a button event of some kind. This is either a keyboard or mouse button (or some other kind of button) changing state from up to down, or vice-versa, or it is a single “keystroke”.
A keystroke is different than a button event in that (a) it does not necessarily correspond to a physical button on a keyboard, but might be the result of a combination of buttons (e.g. “A” is the result of shift + “a”); and (b) it does not manage separate “up” and “down” events, but is itself an instantaneous event.
Normal up/down button events can be used to track the state of a particular button on the keyboard, while keystroke events are best used to monitor what a user is attempting to type.
Button up/down events are defined across all the physical keys on the keyboard (and other buttons for which there is a corresponding ButtonHandle object), while keystroke events are defined across the entire Unicode character set.
This API should not be considered stable and may change in a future version of Panda3D.
Inheritance diagram
- TCandidate = 5
- TDown = 0
- TKeystroke = 4
- TMove = 6
- TRawDown = 7
- TRawUp = 8
- TRepeat = 3
- TResumeDown = 1
- TUp = 2
- T_candidate = 5
- T_down = 0
- T_keystroke = 4
- T_move = 6
- T_raw_down = 7
- T_raw_up = 8
- T_repeat = 3
- T_resume_down = 1
- T_up = 2
- __init__(*args, **kwargs)
- button
- keycode
- time
- type