2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
10 #include <proto/exec.h>
11 #include <exec/tasks.h>
12 #include <exec/lists.h>
13 #include <exec/memory.h>
15 #include "input_intern.h"
17 /***************************
18 ** GetEventsFromQueue() **
19 ***************************/
20 struct InputEvent
*GetEventsFromQueue(struct inputbase
*InputDevice
)
22 struct InputEvent
*ie
;
24 ie
= InputDevice
->EventQueueHead
;
26 /* No more events in the queue */
27 InputDevice
->EventQueueHead
= NULL
;
28 InputDevice
->EventQueueTail
= NULL
;
38 /* Adds a chian of InputEvents to the eventqueue */
39 VOID
AddEQTail(struct InputEvent
*ie
, struct inputbase
*InputDevice
)
42 if (InputDevice
->pub
.id_Flags
& IDF_SWAP_BUTTONS
)
48 /* FIXME: add more event classes to which this is applicable */
49 case IECLASS_RAWMOUSE
:
50 code
= ie
->ie_Code
& ~IECODE_UP_PREFIX
;
54 code
= IECODE_RBUTTON
;
57 code
= IECODE_LBUTTON
;
61 ie
->ie_Code
= code
| (ie
->ie_Code
& IECODE_UP_PREFIX
);
65 if (!InputDevice
->EventQueueHead
) /* Empty queue ? */
67 InputDevice
->EventQueueHead
= ie
;
71 InputDevice
->EventQueueTail
->ie_NextEvent
= ie
;
74 /* Get last event in eventchain to add */
75 while (ie
->ie_NextEvent
)
76 ie
= ie
->ie_NextEvent
;
78 InputDevice
->EventQueueTail
= ie
;
83 /*********************
85 *********************/
86 BOOL
IsQualifierKey(UWORD key
)
90 key
&= ~IECODE_UP_PREFIX
;
92 if ((key
>= 0x60) && (key
<= 0x67))
100 /************************
101 ** IsKeyRepeatable() **
102 ************************/
103 BOOL
IsRepeatableKey(UWORD key
)
107 key
&= ~IECODE_UP_PREFIX
;
109 /* stegerg: It looks like this is really all so no need to
110 check the keymap->repeatable tables. I have checked this
111 on the Amiga. All keys except the qualifier keys are
112 treated as repeatable raw (!!!) keys. Here in input.device
113 we have only raw keys. For vanilla keys there's MapRawKey()
114 and this function thakes care of filtering out repeated
115 raw keys if the corresponding KeyMap->repeatable table says
116 that this key is not repeatable */
118 if (IsQualifierKey(key
))