summaryrefslogtreecommitdiff
path: root/atari/nkcc.h
blob: c7b09595e502d1532fe3db0be70d18e512bbe4ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
 * $Id: nkcc.h,v 1.4 2010/10/16 21:21:51 hek Exp $
 *
 * XaAES - XaAES Ain't the AES (c) 1992 - 1998 C.Graham
 *                                 1999 - 2003 H.Robbers
 *                                        2004 F.Naumann & O.Skancke
 *
 * A multitasking AES replacement for FreeMiNT
 *
 * This file is part of XaAES.
 *
 * XaAES is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * XaAES is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with XaAES; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * Project name : NORMALIZED KEY CODE CONVERTER (NKCC)
 * Module name  : Global definitions
 * Symbol prefix: nkc
 *
 * Author       : Harald Siegmund (HS)
 * Co-Authors   : Henk Robbers (Reductions for use in XaAES)
 * Write access : HS
 */

#ifndef _nkcc_h
#define _nkcc_h

/* flags for NKCC initialization */

#define NKI_BUTHND   0x00000001UL   /* install button event handler */
#define NKI_BHTOS    0x00000002UL   /* additional flag: only if TOS has */
                                    /*  mouse click bug */
#define NKI_NO200HZ  0x00000004UL   /* don't install 200 Hz clock interrupt */
                                    /*  (this flag is ignored if the button */
                                    /*  event handler is being activated) */

/* flag combinations for compatibility with old versions of NKCC */

#define BE_ON        NKI_BUTHND
#define BE_OFF       0
#define BE_TOS       (NKI_BUTHND | NKI_BHTOS)


/* flags for special key code handling */

#define NKS_ALTNUM   0x00000001UL   /* Alt + numeric pad -> ASCII */
#define NKS_CTRL     0x00000002UL   /* Control key emulation */
                                    /* deadkey management: */
#define NKS_D_CIRCUM 0x00010000UL   /* ^  accent circumflex */
#define NKS_D_TILDE  0x00020000UL   /* ~  accent tilde */
#define NKS_D_AGUI   0x00040000UL   /* '  accent agui */
#define NKS_D_GRAVE  0x00080000UL   /* `  accent grave */
#define NKS_D_UMLAUT 0x00100000UL   /* �  umlaut */
#define NKS_D_QUOTE  0x00200000UL   /* "  quote, synonym for umlaut */
#define NKS_D_SMOERE 0x00400000UL   /* �  smoerebroed */
#define NKS_D_CEDIL  0x00800000UL   /* ,  cedil */
#define NKS_D_SLASH  0x01000000UL   /* /  slash, for scandinavian characters */
#define NKS_DEADKEY  0xffff0000UL   /* all deadkeys */

/* NKCC key code flags */

#define NKF_FUNC     0x8000         /* function          */
#define NKF_RESVD    0x4000         /* resvd, ignore it! */
#define NKF_NUM      0x2000         /* numeric pad       */
#define NKF_CAPS     0x1000         /* CapsLock          */
#define NKF_ALT      0x0800         /* Alternate         */
#define NKF_CTRL     0x0400         /* Control           */
#define NKF_SHIFT    0x0300         /* any Shift key     */
#define NKF_LSH      0x0200         /* left Shift key    */
#define NKF_RSH      0x0100         /* right Shift key   */

#define NKF_IGNUM    NKF_RESVD      /* special flag for nkc_cmp() */

/* special key codes for keys performing a function */

#define NK_INVALID   0x00           /* invalid key code  */
#define NK_UP        0x01           /* cursor up         */
#define NK_DOWN      0x02           /* cursor down       */
#define NK_RIGHT     0x03           /* cursor right      */
#define NK_LEFT      0x04           /* cursor left       */
#define NK_M_PGUP    0x05           /* MAC Page up       */
#define NK_M_PGDOWN  0x06           /* MAC Page down     */
#define NK_M_END     0x07           /* reserved!         */
#define NK_BS        0x08           /* Backspace         */
#define NK_TAB       0x09           /* Tab               */
#define NK_ENTER     0x0a           /* Enter             */
#define NK_INS       0x0b           /* Insert            */
#define NK_CLRHOME   0x0c           /* Clr/Home          */
#define NK_HOME      0x0c           /* Clr/Home          */
#define NK_RET       0x0d           /* Return            */
#define NK_HELP      0x0e           /* Help              */
#define NK_UNDO      0x0f           /* Undo              */
#define NK_F1        0x10           /* function key #1   */
#define NK_F2        0x11           /* function key #2   */
#define NK_F3        0x12           /* function key #3   */
#define NK_F4        0x13           /* function key #4   */
#define NK_F5        0x14           /* function key #5   */
#define NK_F6        0x15           /* function key #6   */
#define NK_F7        0x16           /* function key #7   */
#define NK_F8        0x17           /* function key #8   */
#define NK_F9        0x18           /* function key #9   */
#define NK_F10       0x19           /* function key #10  */
#define NK_RVD1A     0x1a           /* reserved!         */
#define NK_ESC       0x1b           /* Esc               */
#define NK_RVD1C     0x1c           /* reserved!         */
#define NK_RVD1D     0x1d           /* reserved!         */
#define NK_RVD1E     0x1e           /* reserved!         */
#define NK_DEL       0x1f           /* Delete            */

                                    /* terminator for key code tables */
#define NK_TERM      ((int)(NKF_FUNC | NK_INVALID))

/* ASCII codes less than 32 */

#define NUL          0x00           /* Null */
#define SOH          0x01           /* Start Of Header */
#define STX          0x02           /* Start Of Text */
#define ETX          0x03           /* End Of Text */
#define EOT          0x04           /* End Of Transmission */
#define ENQ          0x05           /* Enquiry */
#define ACK          0x06           /* positive Acknowledgement */
#define BEL          0x07           /* Bell */
#define BS           0x08           /* BackSpace */
#define HT           0x09           /* Horizontal Tab */
#define LF           0x0a           /* Line Feed */
#define VT           0x0b           /* Vertical Tab */
#define FF           0x0c           /* Form Feed */
#define CR           0x0d           /* Carriage Return */
#define SO           0x0e           /* Shift Out */
#define SI           0x0f           /* Shift In */
#define DLE          0x10           /* Data Link Escape */
#define DC1          0x11           /* Device Control 1 */
#define XON          0x11           /* same as DC1 */
#define DC2          0x12           /* Device Control 2 */
#define DC3          0x13           /* Device Control 3 */
#define XOFF         0x13           /* same as DC3 */
#define DC4          0x14           /* Device Control 4 */
#define NAK          0x15           /* Negative Acknowledgement */
#define SYN          0x16           /* Synchronize */
#define ETB          0x17           /* End of Transmission Block */
#define CAN          0x18           /* Cancel */
#define EM           0x19           /* End of Medium */
#define SUB          0x1a           /* Substitute */
#define ESC          0x1b           /* Escape */
#define FS           0x1c           /* Form Separator */
#define GS           0x1d           /* Group Separator */
#define RS           0x1e           /* Record Separator */
#define US           0x1f           /* Unit Separator */

/* XBRA vector link/unlink modes */

#define NKXM_NUM     0              /* by vector number */
#define NKXM_ADR     1              /* by vector address */

/* additional flag in event mask */

#define MU_XTIMER    0x100


/* deinstall NKCC */
int nkc_exit(void);

/* from cflib */
short nkc_init(void);

unsigned short nkc_tos2n(long toskey);
unsigned short gem_to_norm(short ks, short kr);

/* XaAES used names */
#define nkc_tconv nkc_tos2n
#define normkey gem_to_norm

#endif /* _nkcc_h */