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
ButtonHandleobject), 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.
enumerator T_down = 0
T_down is sent when a button was just pressed.
enumerator T_resume_down = 1
T_resume_down is a special event that is only thrown when focus is returned to a window and a button is detected as being held down at that point; it indicates that the button should be considered down now (if it wasn’t already), but it didn’t just get pressed down at this moment, it was depressed some time ago. It’s mainly used for correct tracking of modifier keys like shift and control, and can be ignored for other keys.
enumerator T_up = 2
T_down is sent when a button is released.
enumerator T_repeat = 3
T_repeat is sent for each a keyrepeat event generated by the system, for a button that is continually held down. If you want to respect keyrepeat, treat T_down and T_repeat equivalently.
enumerator T_keystroke = 4
T_keystroke is a special keystroke event, and is sent along with a Unicode keycode value, not a ButtonHandle.
enumerator T_candidate = 5
T_candidate is used to indicate that the user is using the IME and has in the process of selecting some possible text to type from a menu.
enumerator T_move = 6
T_move is used to indicate that the mouse has moved within the current region. Button drag mode needs this, others may ignore this event
enumerator T_raw_down = 7
T_raw_down is usually sent together with T_down, except that this is the original, untransformed scan key sent by the keyboard. It is not altered by modifier keys and acts as if the user is using the US (qwerty) keyboard layout.
enumerator T_raw_up = 8
- enumerator T_down = 0
- enum Type