Throws Panda Events for button down/up events generated within the data graph.
More...
Public Member Functions |
|
| ButtonThrower (const string &name) |
| void | add_parameter (const EventParameter &obj) |
| | Adds the indicated parameter to the list of parameters that will be passed with each event generated by this ButtonThrower.
|
| bool | add_throw_button (const ModifierButtons &mods, const ButtonHandle &button) |
| | Adds a new button to the set of buttons that the ButtonThrower explicitly processes.
|
| void | clear_throw_buttons () |
| | Empties the set of buttons that were added via add_throw_button().
|
|
virtual TypeHandle | force_init_type () |
| const string & | get_button_down_event () const |
| | Returns the button_down_event that has been set on this ButtonThrower.
|
| const string & | get_button_repeat_event () const |
| | Returns the button_repeat_event that has been set on this ButtonThrower.
|
| const string & | get_button_up_event () const |
| | Returns the button_up_event that has been set on this ButtonThrower.
|
| const string & | get_candidate_event () const |
| | Returns the candidate_event that has been set on this ButtonThrower.
|
| const string & | get_keystroke_event () const |
| | Returns the keystroke_event that has been set on this ButtonThrower.
|
| const ModifierButtons & | get_modifier_buttons () const |
| | Returns the set of ModifierButtons that the ButtonThrower will consider important enough to prepend the event name with.
|
| const string & | get_move_event () const |
| | Returns the move_event that has been set on this ButtonThrower.
|
| int | get_num_parameters () const |
| | Returns the number of parameters that have been added to the list of parameters to be passed with each event generated by this ButtonThrower.
|
| EventParameter | get_parameter (int n) const |
| | Returns the nth parameter that has been added to the list of parameters passed with each event generated by this ButtonThrower.
|
| const string & | get_prefix () const |
| | Returns the prefix that has been set on this ButtonThrower.
|
| bool | get_specific_flag () const |
| | Returns the flag that indicates whether specific events should be generated.
|
| bool | get_throw_buttons_active () const |
| | Returns the flag that indicates whether the ButtonThrower will only process events for the explicitly named buttons or not.
|
| bool | get_time_flag () const |
| | Returns the flag that indicates whether the time of the button event should be passed as a parameter.
|
|
virtual TypeHandle | get_type () const |
| bool | has_throw_button (const ButtonHandle &button) const |
| | Returns true if the indicated button, in conjunction with any nonspecified modifier buttons, is on the set of buttons that will be processed by the ButtonThrower.
|
| bool | has_throw_button (const ModifierButtons &mods, const ButtonHandle &button) const |
| | Returns true if the indicated button is on the set of buttons that will be processed by the ButtonThrower, false otherwise.
|
|
| MAKE_SEQ (get_parameters, get_num_parameters, get_parameter) |
| bool | remove_throw_button (const ModifierButtons &mods, const ButtonHandle &button) |
| | Removes the indicated button from the set of buttons that the ButtonThrower explicitly processes.
|
| void | set_button_down_event (const string &button_down_event) |
| | Specifies the generic event that is generated (if any) each time a key or button is depressed.
|
| void | set_button_repeat_event (const string &button_repeat_event) |
| | Specifies the generic event that is generated (if any) repeatedly while a key or button is held down.
|
| void | set_button_up_event (const string &button_up_event) |
| | Specifies the generic event that is generated (if any) each time a key or button is released.
|
| void | set_candidate_event (const string &candidate_event) |
| | Specifies the event that is generated (if any) for each IME candidate string event received.
|
| void | set_keystroke_event (const string &keystroke_event) |
| | Specifies the event that is generated (if any) for each keystroke that is received.
|
| void | set_modifier_buttons (const ModifierButtons &mods) |
| | Changes the set of ModifierButtons that the ButtonThrower will consider important enough to prepend the event name with.
|
| void | set_move_event (const string &move_event) |
| | Specifies the event that is generated (if any) each time the mouse is moved within the window.
|
| void | set_prefix (const string &prefix) |
| | Sets the prefix which is prepended to all specific event names (that is, event names generated from the button name itself, as opposed to the generic event names like set_button_down_event) thrown by this object.
|
| void | set_specific_flag (bool specific_flag) |
| | Sets the flag that indicates whether specific events (events prefixed by set_prefix, and based on the event name) should be generated at all.
|
| void | set_throw_buttons_active (bool flag) |
| | Sets the flag that indicates whether the ButtonThrower will only process events for the explicitly named buttons or not.
|
| void | set_time_flag (bool time_flag) |
| | Sets the flag that indicates whether the time of the button event should be passed as a parameter or not.
|
| virtual void | write (ostream &out, int indent_level=0) const |
| | Throw all events for button events found in the data element.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Protected Member Functions |
| virtual void | do_transmit_data (DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output) |
| | The virtual implementation of transmit_data().
|
Throws Panda Events for button down/up events generated within the data graph.
This is a DataNode which is intended to be parented to the data graph below a device which is generating a sequence of button events, like a MouseAndKeyboard device. It simply takes each button it finds and throws a corresponding event based on the button name via the throw_event() call.
Definition at line 39 of file buttonThrower.h.
| void ButtonThrower::set_candidate_event |
( |
const string & |
candidate_event | ) |
[inline] |
Specifies the event that is generated (if any) for each IME candidate string event received.
Events of this nature are received only when the user is entering data using a Microsoft Input Method Editor, typically used for Asian languages such as Japanese or Korean.
If you are designing a typing user interface, you should track this event to support the use of the IME. In response to this event, you should display the candidate string in the entry box, with the appropriate sections highlighted, so the user can scroll through the available choices.
This event is generated with four parameters, in order: the candidate string, the character at which to start the highlight, the character at which to end the highlight, and the current cursor position.
Definition at line 166 of file buttonThrower.I.
| void ButtonThrower::set_keystroke_event |
( |
const string & |
keystroke_event | ) |
[inline] |
Specifies the event that is generated (if any) for each keystroke that is received.
A keystroke is different than a button event: it represents the semantic meaning of the sequence of keys that have been pressed. For instance, pressing shift and 4 together will generate the button event "shift-4", but it will generate the keystroke "$".
If a key is held down, keyrepeat will cause the same keystroke event to be generated repeatedly. This is different from the corresponding down event, which will only be generated once, followed by a number of button repeat events.
This event is generated with a single wstring parameter, which is a one-character string that contains the keystroke generated. If this event string is empty, no event is generated.
See also set_button_down_event().
Definition at line 128 of file buttonThrower.I.