2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
14 #include <libraries/commodities.h>
15 #include <devices/inputevent.h>
16 #include <proto/commodities.h>
18 #include <aros/debug.h>
20 #define DEBUG_MATCHIX(x) ;//if ((event->ie_Class == IECLASS_RAWMOUSE) || (event->ie_Class == IECLASS_POINTERPOS) || (event->ie_Class == IECLASS_NEWPOINTERPOS)) x;
23 AROS_LH2(BOOL
, MatchIX
,
27 AROS_LHA(struct InputEvent
*, event
, A0
),
28 AROS_LHA(IX
* , ix
, A1
),
32 struct Library
*, CxBase
, 34, Commodities
)
36 Check if an input event matches an input expression.
40 event -- the input event to match against the input expression
41 ix -- the input expression
45 TRUE if the input event matches the input expression, FALSE otherwise.
49 Applications don't normally need this function as filter objects take
50 care of the event filtering. However, this function is in some cases
59 <libraries/commodities.h>, ParseIX()
65 ******************************************************************************/
73 DEBUG_MATCHIX(dprintf("MatchIX: ev[0x%lx, 0x%lx, 0x%lx] ix[0x%lx, (0x%lx, 0x%lx), (0x%lx, 0x%lx, 0x%lx)]\n",
74 event
->ie_Class
, event
->ie_Code
, event
->ie_Qualifier
,
75 ix
->ix_Class
, ix
->ix_Code
, ix
->ix_CodeMask
,
76 ix
->ix_Qualifier
, ix
->ix_QualMask
, ix
->ix_QualSame
));
78 if (ix
->ix_Class
== IECLASS_NULL
)
80 DEBUG_MATCHIX(dprintf("MatchIX: IECLASS_NULL\n"));
84 if (event
->ie_Class
!= ix
->ix_Class
)
86 DEBUG_MATCHIX(dprintf("MatchIX: fail\n"));
90 DEBUG_MATCHIX(dprintf("Code: ie %lx ix: %lx\n", event
->ie_Code
, ix
->ix_Code
));
92 if (((ix
->ix_Code
^ event
->ie_Code
) & ix
->ix_CodeMask
) != 0)
94 DEBUG_MATCHIX(dprintf("MatchIX: fail\n"));
98 temp
= event
->ie_Qualifier
;
99 DEBUG_MATCHIX(dprintf("Code: temp %lx\n", temp
));
101 if ((qual
= ix
->ix_QualSame
) != 0)
103 if ((qual
& IXSYM_SHIFT
) != 0)
105 if ((temp
& IXSYM_SHIFTMASK
) != 0)
107 temp
|= IXSYM_SHIFTMASK
;
111 if ((qual
& IXSYM_CAPS
) != 0)
113 if ((temp
& IXSYM_CAPSMASK
) != 0)
115 temp
|= IXSYM_CAPSMASK
;
119 if ((qual
& IXSYM_ALT
) != 0)
121 if ((temp
& IXSYM_ALTMASK
) != 0)
123 temp
|= IXSYM_ALTMASK
;
127 DEBUG_MATCHIX(dprintf("Code: temp %lx\n", temp
));
129 if (((temp
^ ix
->ix_Qualifier
) & ix
->ix_QualMask
) == 0)
131 DEBUG_MATCHIX(dprintf("MatchIX: ok\n"));
136 DEBUG_MATCHIX(dprintf("MatchIX: fail\n"));