panda3d.core.MouseWatcherParameter

class MouseWatcherParameter

This is sent along as a parameter to most events generated for a region to indicate the mouse and button state for the event.

Inheritance diagram

Inheritance diagram of MouseWatcherParameter

getButton() → ButtonHandle

Returns the mouse or keyboard button associated with this event. If hasButton(), above, returns false, this returns ButtonHandle.none().

Return type

ButtonHandle

getCandidateStringEncoded() → str

Returns the candidate string associated with this event. If hasCandidate(), above, returns false, this returns the empty string.

getCandidateStringEncoded(encoding: Encoding) → str

Returns the candidate string associated with this event. If hasCandidate(), above, returns false, this returns the empty string.

getCursorPos() → size_t

Returns the position of the user’s edit cursor within the candidate string.

Return type

size_t

getHighlightEnd() → size_t

Returns one more than the last highlighted character in the candidate string.

Return type

size_t

getHighlightStart() → size_t

Returns the first highlighted character in the candidate string.

Return type

size_t

getKeycode() → int

Returns the keycode associated with this event. If hasKeycode(), above, returns false, this returns 0.

getModifierButtons() → ModifierButtons

Returns the set of modifier buttons that were being held down while the event was generated.

Return type

ModifierButtons

getMouse() → LPoint2

Returns the mouse position at the time the event was generated, in the normalized range (-1 .. 1). It is valid to call this only if hasMouse() returned true.

Return type

LPoint2

hasButton() → bool

Returns true if this parameter has an associated mouse or keyboard button, false otherwise.

hasCandidate() → bool

Returns true if this parameter has an associated candidate string, false otherwise.

hasKeycode() → bool

Returns true if this parameter has an associated keycode, false otherwise.

hasMouse() → bool

Returns true if this parameter has an associated mouse position, false otherwise.

isKeyrepeat() → bool

Returns true if the button-down even was generated due to keyrepeat, or false if it was an original button down.

isOutside() → bool

Returns true if the mouse was outside the region at the time the event was generated, false otherwise. This is only valid for “release” type events.

output(out: ostream) → None