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

ButtonHandle get_button(void) const

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

std::string get_candidate_string_encoded(void) const
std::string get_candidate_string_encoded(TextEncoder::Encoding encoding) const

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

std::size_t get_cursor_pos(void) const

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

std::size_t get_highlight_end(void) const

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

std::size_t get_highlight_start(void) const

Returns the first highlighted character in the candidate string.

int get_keycode(void) const

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

ModifierButtons const &get_modifier_buttons(void) const

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

LPoint2 const &get_mouse(void) const

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.

bool has_button(void) const

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

bool has_candidate(void) const

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

bool has_keycode(void) const

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

bool has_mouse(void) const

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

bool is_keyrepeat(void) const

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

bool is_outside(void) const

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.

void output(std::ostream &out) const