1 #ifndef KEYBOARD_INTERN_H
2 #define KEYBOARD_INTERN_H
5 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
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>
20 #define KB_MAXKEYS 256
21 #define KB_MATRIXSIZE (KB_MAXKEYS/(sizeof(UBYTE)*8))
23 #define KB_BUFFERSIZE 128
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 */
40 BOOL kb_ResetPhase
; /* True if reset has begun */
43 OOP_Object
*kb_Hidd
; /* Hidd object to use */
44 struct Library
*kb_OOPBase
;
46 OOP_AttrBase HiddKbdAB_
;
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
56 struct MinList kb_kbunits
;
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 */
68 #define KBUB_PENDING 0 /* Unit has pending request for keyevents */
70 #define KBUF_PENDING 0x01
73 #define HiddKbdAB KBBase->HiddKbdAB_
75 #endif /* KEYBOARD_INTERN_H */