diskimage: Compiler delint
[AROS.git] / rom / devs / keyboard / keyboard_intern.h
blobf614e57b73a09c98a7627bbf4810f95286f915c9
1 #ifndef KEYBOARD_INTERN_H
2 #define KEYBOARD_INTERN_H
4 /*
5 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc:
9 Lang: English
12 #include <exec/types.h>
13 #include <exec/devices.h>
14 #include <exec/semaphores.h>
15 #include <exec/interrupts.h>
16 #include <exec/devices.h>
18 #include <oop/oop.h>
20 #define KB_MAXKEYS 256
21 #define KB_MATRIXSIZE (KB_MAXKEYS/(sizeof(UBYTE)*8))
23 #define KB_BUFFERSIZE 128
25 struct KeyboardBase
27 struct Device kb_device;
28 struct Library *kb_KbdHiddBase;
30 struct MinList kb_PendingQueue; /* IOrequests (KBD_READEVENT) not done quick */
31 struct SignalSemaphore kb_QueueLock;
32 struct MinList kb_ResetHandlerList;
34 struct Interrupt kb_Interrupt; /* Interrupt to invoke in case of keypress (or
35 releases) and there are pending requests */
37 UWORD kb_nHandlers; /* Number of reset handlers added */
38 UWORD *kb_keyBuffer;
39 UWORD kb_writePos;
40 BOOL kb_ResetPhase; /* True if reset has begun */
41 UBYTE *kb_Matrix;
43 OOP_Object *kb_Hidd; /* Hidd object to use */
44 struct Library *kb_OOPBase;
46 OOP_AttrBase HiddKbdAB_;
48 /* FIXME:
49 * m68k lowlevel.library stores only io_Device field after keyboard.device
50 * has been opened and when it is time to close it, lowlevel reuses old
51 * iorequest (which was used for other purposes originally), sets io_Device
52 * and calls CloseDevice(). Which means we can't assume io_Unit is valid.
53 * we leak memory if above happens but it is much better than freeing
54 * random memory
56 struct MinList kb_kbunits;
60 typedef struct KBUnit
62 struct MinNode node;
63 UWORD kbu_readPos; /* Position in the key buffer */
64 UWORD kbu_Qualifiers; /* Known qualifiers at this moment */
65 UWORD kbu_LastCode; /* Previous rawkey code */
66 UBYTE kbu_LastQuals; /* Lower half of previous qualifiers */
67 UWORD kbu_LastLastCode; /* The rawkey code two keys ago... */
68 UBYTE kbu_LastLastQuals; /* ...and the lower half of qualifiers
69 associated with that code */
71 /* Note: The xxxQuals is UBYTE for now. They may be UWORDS at a later
72 implementation but as we want to be binary compatible,
73 we just store UBYTEs in the InputEvent. This goes for
74 deadkey handling too, but as it is a fact that keycodes will
75 be UWORDS here in the future, it's so now. Regarding the
76 qualifiers, it may be enough with 8. */
78 UBYTE kbu_flags; /* For unit flags definitions, see below */
79 } KBUnit;
81 #define KBUB_PENDING 0 /* Unit has pending request for keyevents */
83 #define KBUF_PENDING 0x01
85 #undef HiddKbdAB
86 #define HiddKbdAB KBBase->HiddKbdAB_
88 #endif /* KEYBOARD_INTERN_H */