MouseEvent.hh
00001 /*
00002  * Copyright 2011 Nate Koenig & Andrew Howard
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  *
00016 */
00017 #ifndef MOUSEEVENT_HH
00018 #define MOUSEEVENT_HH
00019 
00020 #include "math/Vector2i.hh"
00021 
00022 namespace gazebo
00023 {
00024   namespace common
00025   {
00028 
00030     class MouseEvent
00031     {
00032       public: enum Buttons {NO_BUTTON = 0x0, LEFT = 0x1, MIDDLE = 0x2, RIGHT = 0x4};
00033       public: enum EventType {NO_EVENT, MOVE, PRESS, RELEASE, SCROLL};
00034 
00035       public: MouseEvent()
00036               : pos(0,0), prevPos(0,0), pressPos(0,0), scroll(0,0),
00037                 moveScale(0.01),dragging(false), type(NO_EVENT), buttons(NO_BUTTON) 
00038               {}
00039 
00040       public: math::Vector2i pos; 
00041       public: math::Vector2i prevPos;
00042       public: math::Vector2i pressPos; 
00043       public: math::Vector2i scroll; 
00044 
00045       public: float moveScale;
00046       public: bool dragging;
00047 
00048       public: EventType type;
00049 
00050       // The button which caused the event
00051       public: unsigned int button;
00052 
00054       public: unsigned int buttons;
00055 
00056       public: bool shift;
00057       public: bool control;
00058     };
00060   }
00061 }
00062 #endif