MouseWatcherParameter

from panda3d.core import MouseWatcherParameter
class MouseWatcherParameter

Bases:

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

get_button() ButtonHandle

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

get_candidate_string_encoded() str

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

get_candidate_string_encoded(encoding: Encoding) str

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

get_cursor_pos() int

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

get_highlight_end() int

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

get_highlight_start() int

Returns the first highlighted character in the candidate string.

get_keycode() int

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

get_modifier_buttons() ModifierButtons

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

get_mouse() 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 has_mouse() returned true.

has_button() bool

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

has_candidate() bool

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

has_keycode() bool

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

has_mouse() bool

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

is_keyrepeat() bool

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

is_outside() 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)