buttonEvent.h

Go to the documentation of this file.
00001 #ifndef BUTTONEVENT_H
00002 #define BUTTONEVENT_H
00003 
00004 #include <BALL/VIEW/KERNEL/common.h>
00005 #include <BALL/VIEW/INPUT/deviceEvent.h>
00006 
00007 #include <QtCore/QEvent>
00008 
00009 namespace BALL
00010 {
00011   namespace VIEW
00012   {
00013     enum InputDeviceButton {
00014       BUTTON1 = 1 << 0,
00015       BUTTON2 = 1 << 1,
00016       BUTTON3 = 1 << 2,
00017       BUTTON4 = 1 << 3,
00018       BUTTON5 = 1 << 4,
00019       BUTTON6 = 1 << 5,
00020       BUTTON7 = 1 << 6,
00021       BUTTON8 = 1 << 7,
00022       BUTTON9 = 1 << 8,
00023       BUTTON10 = 1 << 9,
00024       BUTTON11 = 1 << 10,
00025       BUTTON12 = 1 << 11
00026     };
00027 
00028     typedef QFlags<InputDeviceButton> InputDeviceButtons;
00029 
00034     class ButtonEvent : public DeviceEvent
00035     {
00036       public:
00037         ButtonEvent(EventsIDs type, InputDeviceDriver* dev, InputDeviceButton cause);
00038         ButtonEvent(EventsIDs type, InputDeviceDriver* dev, InputDeviceButton cause, InputDeviceButtons buttons);
00039 
00043         InputDeviceButton button() const { return cause_; }
00044 
00048         InputDeviceButtons buttons() const { return buttons_; }
00049       private:
00050         InputDeviceButton cause_;
00051         InputDeviceButtons buttons_;
00052     };
00053 
00054   }
00055 }
00056 
00057 #endif //BUTTONEVENT_H
00058