Panda3D
Public Member Functions | List of all members
MouseWatcherParameter Class Reference

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

Inheritance diagram for MouseWatcherParameter:
PGMouseWatcherParameter

Public Member Functions

ButtonHandle getButton ()
 Returns the mouse or keyboard button associated with this event. More...
 
str getCandidateStringEncoded ()
 Returns the candidate string associated with this event. More...
 
str getCandidateStringEncoded (TextEncoder::Encoding encoding)
 Returns the candidate string associated with this event. More...
 
int getCursorPos ()
 Returns the position of the user's edit cursor within the candidate string. More...
 
int getHighlightEnd ()
 Returns one more than the last highlighted character in the candidate string. More...
 
int getHighlightStart ()
 Returns the first highlighted character in the candidate string. More...
 
int getKeycode ()
 Returns the keycode associated with this event. More...
 
const ModifierButtons getModifierButtons ()
 Returns the set of modifier buttons that were being held down while the event was generated. More...
 
const LPoint2 getMouse ()
 Returns the mouse position at the time the event was generated, in the normalized range (-1 . More...
 
bool hasButton ()
 Returns true if this parameter has an associated mouse or keyboard button, false otherwise. More...
 
bool hasCandidate ()
 Returns true if this parameter has an associated candidate string, false otherwise. More...
 
bool hasKeycode ()
 Returns true if this parameter has an associated keycode, false otherwise. More...
 
bool hasMouse ()
 Returns true if this parameter has an associated mouse position, false otherwise. More...
 
bool isKeyrepeat ()
 Returns true if the button-down even was generated due to keyrepeat, or false if it was an original button down. More...
 
bool isOutside ()
 Returns true if the mouse was outside the region at the time the event was generated, false otherwise. More...
 
 output (Ostream out)
 

Detailed Description

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

Member Function Documentation

◆ getButton()

ButtonHandle getButton ( )

Returns the mouse or keyboard button associated with this event.

If has_button(), above, returns false, this returns ButtonHandle::none().

◆ getCandidateStringEncoded() [1/2]

str getCandidateStringEncoded ( )

Returns the candidate string associated with this event.

If has_candidate(), above, returns false, this returns the empty string.

◆ getCandidateStringEncoded() [2/2]

str getCandidateStringEncoded ( TextEncoder::Encoding  encoding)

Returns the candidate string associated with this event.

If has_candidate(), above, returns false, this returns the empty string.

◆ getCursorPos()

int getCursorPos ( )

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

◆ getHighlightEnd()

int getHighlightEnd ( )

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

◆ getHighlightStart()

int getHighlightStart ( )

Returns the first highlighted character in the candidate string.

◆ getKeycode()

int getKeycode ( )

Returns the keycode associated with this event.

If has_keycode(), above, returns false, this returns 0.

◆ getModifierButtons()

const ModifierButtons getModifierButtons ( )

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

◆ getMouse()

const LPoint2 getMouse ( )

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.

◆ hasButton()

bool hasButton ( )

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

◆ hasCandidate()

bool hasCandidate ( )

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

◆ hasKeycode()

bool hasKeycode ( )

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

◆ hasMouse()

bool hasMouse ( )

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

◆ isKeyrepeat()

bool isKeyrepeat ( )

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

◆ isOutside()

bool isOutside ( )

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

output ( Ostream  out)