Indentation fix, cleanup.
[AROS.git] / rom / devs / keyboard / keyboard_intern.h
blobd07aff073564fe9946d6656632fce83feae48691
1 #ifndef KEYBOARD_INTERN_H
2 #define KEYBOARD_INTERN_H
4 /*
5 Copyright © 1995-2014, 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 UBYTE kbu_flags; /* For unit flags definitions, see below */
66 } KBUnit;
68 #define KBUB_PENDING 0 /* Unit has pending request for keyevents */
70 #define KBUF_PENDING 0x01
72 #undef HiddKbdAB
73 #define HiddKbdAB KBBase->HiddKbdAB_
75 #endif /* KEYBOARD_INTERN_H */