Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ButtonEvent Class Reference

Records a button event of some kind. More...

#include <buttonEvent.h>

List of all members.

Public Types

enum  Type { T_down, T_resume_down, T_up, T_keystroke }

Public Member Functions

 ButtonEvent ()
 ButtonEvent (ButtonHandle button, Type type)
 ButtonEvent (short keycode)
 ButtonEvent (const ButtonEvent &copy)
void operator= (const ButtonEvent &copy)
bool operator== (const ButtonEvent &other) const
bool operator!= (const ButtonEvent &other) const
bool operator< (const ButtonEvent &other) const
void output (ostream &out) const

Public Attributes

ButtonHandle _button
short _keycode
Type _type


Detailed Description

Records a button event of some kind.

This is either a keyboard or mouse button (or some other kind of button) changing state from up to down, or vice-versa, or it is a single "keystroke".

A keystroke is different than a button event in that (a) it does not necessarily correspond to a physical button on a keyboard, but might be the result of a combination of buttons (e.g. "A" is the result of shift + "a"); and (b) it does not manage separate "up" and "down" events, but is itself an instantaneous event.

Normal up/down button events can be used to track the state of a particular button on the keyboard, while keystroke events are best used to monitor what a user is attempting to type.

Button up/down events are defined across all the physical keys on the keyboard (and other buttons for which there is a corresponding ButtonHandle object), while keystroke events are defined across the entire Unicode character set.

Definition at line 80 of file buttonEvent.h.


Member Enumeration Documentation

enum ButtonEvent::Type
 

Enumeration values:
T_down 
T_resume_down 
T_up 
T_keystroke 

Definition at line 82 of file buttonEvent.h.


Constructor & Destructor Documentation

ButtonEvent::ButtonEvent  )  [inline]
 

Definition at line 31 of file buttonEvent.I.

ButtonEvent::ButtonEvent ButtonHandle  button,
ButtonEvent::Type  type
[inline]
 

Definition at line 46 of file buttonEvent.I.

References INLINE.

ButtonEvent::ButtonEvent short  keycode  )  [inline]
 

Definition at line 61 of file buttonEvent.I.

References INLINE.

ButtonEvent::ButtonEvent const ButtonEvent &  copy  )  [inline]
 

Definition at line 76 of file buttonEvent.I.

References _button, _keycode, _type, and INLINE.


Member Function Documentation

bool ButtonEvent::operator!= const ButtonEvent &  other  )  const [inline]
 

Definition at line 119 of file buttonEvent.I.

References _type.

bool ButtonEvent::operator< const ButtonEvent &  other  )  const [inline]
 

Definition at line 131 of file buttonEvent.I.

void ButtonEvent::operator= const ButtonEvent &  copy  )  [inline]
 

Definition at line 91 of file buttonEvent.I.

References _button, _keycode, and _type.

bool ButtonEvent::operator== const ButtonEvent &  other  )  const [inline]
 

Definition at line 105 of file buttonEvent.I.

References _button, _keycode, and INLINE.

void ButtonEvent::output ostream &  out  )  const
 

Definition at line 32 of file buttonEvent.cxx.


Member Data Documentation

ButtonHandle ButtonEvent::_button
 

Definition at line 115 of file buttonEvent.h.

Referenced by ButtonEvent(), ModifierButtons::get_num_buttons(), ButtonThrower::has_throw_button(), operator=(), and operator==().

short ButtonEvent::_keycode
 

Definition at line 119 of file buttonEvent.h.

Referenced by ButtonEvent(), operator=(), and operator==().

Type ButtonEvent::_type
 

Definition at line 121 of file buttonEvent.h.

Referenced by ButtonEvent(), ModifierButtons::get_num_buttons(), ButtonThrower::has_throw_button(), operator!=(), and operator=().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:00 2003 for Panda by doxygen1.3