1 #pragma once 2 // Description: 3 // Structure for input triggers. 4 // 5 // Copyright (C) 2001 Frank Becker 6 // 7 // This program is free software; you can redistribute it and/or modify it under 8 // the terms of the GNU General Public License as published by the Free Software 9 // Foundation; either version 2 of the License, or (at your option) any later 10 // version. 11 // 12 // This program is distributed in the hope that it will be useful, but WITHOUT 13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details 15 // 16 17 enum TriggerTypeEnum 18 { 19 eUnknownTrigger, 20 eKeyTrigger, 21 eButtonTrigger, 22 eMotionTrigger 23 }; 24 25 struct Trigger 26 { 27 TriggerTypeEnum type; 28 int data1; 29 int data2; 30 int data3; 31 32 //just for mouse smoothing for now... 33 float fData1; 34 float fData2; 35 TriggerTrigger36 Trigger():type(eUnknownTrigger),data1(0),data2(0),data3(0),fData1(.0f),fData2(.0f) 37 { 38 } 39 operator ==Trigger40 bool operator==(const Trigger &t) const 41 { 42 if( (type==eMotionTrigger) && (type==t.type)) 43 { 44 return true; 45 } 46 //ignore modifiers (data2) and unicode (data3) 47 return( (type==t.type) && 48 (data1==t.data1)); 49 } 50 }; 51