Generate mouse/keyboard events from your mouse.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
interception/MouseDll/event.hpp

54 lines
1.3 KiB

#ifndef EVENT_HPP
#define EVENT_HPP
#include "actions.hpp"
#include "keyboardState.hpp"
#include "utils.hpp"
struct ApiEvent ;
// ---------------------------------------------------------------------
// Represents an event generated by a mouse device (i.e. mouse or scroll-wheel movement)
// and the Action's that should be executed in response to it.
class Event
{
// data types:
public:
enum eEventType {
etMouseLeft=1 , etMouseRight=2 , etMouseUp=3 , etMouseDown=4 ,
etWheelLeft=5 , etWheelRight=6 , etWheelUp=7 , etWheelDown=8
} ;
// constructors/destructor:
public:
Event( const ApiEvent* pEvent , const ApiAction* pActions , int nActions ) ;
DISABLE_COPY_ASSIGNMENT( Event ) ;
// access methods:
public:
eEventType eventType() const ;
const KeyboardState& keyboardState() const ;
const ActionPtrVector& actions() const ;
public:
void dumpEvent( std::ostream& os , const char* pPrefix="" ) const ;
// data members:
private:
eEventType mEventType ;
KeyboardState mKeyboardState ;
ActionPtrVector mActions ;
} ;
typedef PtrVector<Event> EventPtrVector ;
// inserters
std::ostream& operator<<( std::ostream& , const Event& ) ;
std::ostream& operator<<( std::ostream& , const Event::eEventType& ) ;
// ---------------------------------------------------------------------
#endif // EVENT_HPP