4 #include "EventBinding.h" 6 #define EVENT_DRAG_DISTANCE 2 9 #define EVENT_DOUBLECLICK_TIME 300 12 #define SAMPLE_BUFFER_SIZE 1024 16 #define ShiftPressed (((CGUIEvent::KeyStates[EM_KEY_LSHIFT]&0x80)!=0)||((CGUIEvent::KeyStates[EM_KEY_RSHIFT]&0x80)!=0)) 17 #define ControlPressed (((CGUIEvent::KeyStates[EM_KEY_LCONTROL]&0x80)!=0)||((CGUIEvent::KeyStates[EM_KEY_RCONTROL]&0x80)!=0)) 18 #define AltPressed (((CGUIEvent::KeyStates[EM_KEY_LALT]&0x80)!=0)||((CGUIEvent::KeyStates[EM_KEY_RALT]&0x80)!=0)) 19 #define CapsLockPressed ((CGUIEvent::KeyStates[EM_KEY_CAPSLOCK]&0x01)!=0) 20 #define NumLockPressed ((CGUIEvent::KeyStates[EM_KEY_NUMLOCK]&0x01)!=0) 27 #define RetainLeftState(x) ((x)&0x7) 28 #define RetainRightState(x) (((x)&0x38)>>3) 29 #define RetainMiddleState(x) (((x)&0x1c0)>>6) 30 #define RetainDragState(x) (((x)&0xe00)>>9) 31 #define RetainKeyState(x) (((x)&0x3000)>>12) 35 class CDirectKeyboard;
83 GUIESMiddleDBClick=256,
92 REPEAT_PRESSED_KEYS=1,
101 void init(
short x,
short y, DWORD time)
103 this->x=x;this->y=y;this->nTime=time;
143 std::vector <GUI_KEYBOARD_HOLDKEY> HoldKey;
147 memset(KeyEvents,0,
sizeof(KeyEvents[0])*SAMPLE_BUFFER_SIZE);
165 bool IsMapTo(
int eSrcEvent,
int eDestEvent);
174 bool InterpretMessage(
MSG *msg,
int option=0);
175 CEventBinding *GetEventBindingObj(){
return m_eventbinding.get_ptr();}
176 const CEventBinding *GetConstEventBindingObj(){
return m_eventbinding.c_ptr();}
178 bool IsMousePressed(
int mouse);
183 string GetCharSequence();
190 static CHAR GetChar(DWORD key);
194 bool IsKeyPressed(
int key);
201 void AddHoldKey(DWORD key,DWORD nTime);
205 void UpdateKey(
int option);
207 virtual int Release();
208 virtual void Clone(
IObject* obj)
const;
210 virtual bool Equals(
const IObject *obj)
const;
212 void ResetState(){m_eState=GUIESNone;}
213 MSG GenerateMessage();
224 static byte KeyStates[EventCount];
225 static void StaticInit();
227 static int m_nDragBeginDistance;
228 static int m_nDBClickInterval;
Definition: RenderCoreOpenGL.h:38
Definition: GUIEvent.h:97
int m_nTime
the time when the event happen, get using GetTickCount()
Definition: GUIEvent.h:158
Definition: GUIEvent.h:134
Definition: EventBinding.h:22
different physics engine has different winding order.
Definition: EventBinding.h:32
Place of the.
Definition: GUIEvent.h:43
Definition: GUIEvent.h:128
int GetTriggerEvent() const
Set the CEventBinding object of this event.
Definition: GUIEvent.h:173
Definition: IObjectDrag.h:66
base class for object, such as CBaseObject, IAttributeObject, GUI object.
Definition: PERef.h:287
GUI_EVENT_STATE
new 00000000000xxx: Left 00000000xxx000: Right 00000xxx000000: Middle 00xxx000000000: Drag xx00000000...
Definition: GUIEvent.h:68
This class is for maintaining the event binding table and script binding table.
Definition: EventBinding.h:51
Definition: GUIEvent.h:111