some fixes to accented characters
[tangerine.git] / rom / devs / keyboard / keyboard_intern.h
blob7362ff6b7d6091df9d58e4c6a3db55adef5546f9
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_LowLevelBase;
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 */
36 APTR kb_kbIrqHandle; /* Handle from AddKBInt() */
38 UWORD kb_nHandlers; /* Number of reset handlers added */
39 UWORD *kb_keyBuffer;
40 UWORD kb_writePos;
41 BOOL kb_ResetPhase; /* True if reset has begun */
42 UBYTE *kb_Matrix;
44 OOP_Object *kb_Hidd; /* Hidd object to use */
45 struct Library *kb_OOPBase;
47 OOP_AttrBase HiddKbdAB_;
51 typedef struct KBUnit
53 UWORD kbu_readPos; /* Position in the key buffer */
54 UWORD kbu_Qualifiers; /* Known qualifiers at this moment */
55 UWORD kbu_LastCode; /* Previous rawkey code */
56 UBYTE kbu_LastQuals; /* Lower half of previous qualifiers */
57 UWORD kbu_LastLastCode; /* The rawkey code two keys ago... */
58 UBYTE kbu_LastLastQuals; /* ...and the lower half of qualifiers
59 associated with that code */
61 /* Note: The xxxQuals is UBYTE for now. They may be UWORDS at a later
62 implementation but as we want to be binary compatible,
63 we just store UBYTEs in the InputEvent. This goes for
64 deadkey handling too, but as it is a fact that keycodes will
65 be UWORDS here in the future, it's so now. Regarding the
66 qualifiers, it may be enough with 8. */
68 UBYTE kbu_flags; /* For unit flags definitions, see below */
69 } KBUnit;
71 #define KBUB_PENDING 0 /* Unit has pending request for keyevents */
73 #define KBUF_PENDING 0x01
75 #define HiddKbdAB KBBase->HiddKbdAB_
77 #endif /* KEYBOARD_INTERN_H */