summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/akey.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox/akey.h')
-rw-r--r--apps/plugins/zxbox/akey.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/apps/plugins/zxbox/akey.h b/apps/plugins/zxbox/akey.h
new file mode 100644
index 0000000000..033f034da5
--- /dev/null
+++ b/apps/plugins/zxbox/akey.h
@@ -0,0 +1,111 @@
1/*
2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. See the file COPYING.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 */
20
21/* akey.h
22 *
23 * Header of the AKEY module
24 *
25 * Keyboard handeling routines and key identification labels
26 *
27 * Created: 92/12/01 Szeredi Miklos
28 */
29
30
31#ifndef _AKEY_H
32#define _AKEY_H
33
34
35#define NOKEY -1
36#define UNKNOWNKEY -2
37#define ERRKEY -3
38#define MOUSEKEY -256
39
40#define UPKEY (256 + 1)
41#define DOWNKEY (256 + 2)
42#define RIGHTKEY (256 + 3)
43#define LEFTKEY (256 + 4)
44#define INSKEY (256 + 5)
45#define DELKEY (256 + 6)
46#define HOMEKEY (256 + 7)
47#define ENDKEY (256 + 8)
48#define PUKEY (256 + 9)
49#define PDKEY (256 + 10)
50#define BSKEY (256 + 16)
51
52#define FKEYOFFS (256 + 128)
53#define FKEYFIRST (FKEYOFFS + 1)
54#define FKEYLAST (FKEYOFFS + 12)
55#define FKEY(num) (FKEYOFFS + num)
56
57#define ALTKEY (1 << 11)
58#define CTRKEY (1 << 10)
59#define SHKEY (1 << 9)
60
61#define BKTABKEY (TABKEY | SHKEY)
62
63#define CTL(ch) ((ch) - 96)
64#define META(ch) ((ch) | ALTKEY)
65
66#define TABKEY 9
67#define LFKEY 13
68#define CRKEY 10
69#define ENTERKEY LFKEY
70#define ESCKEY 27
71
72#define lastakey() __lastakey
73#define waitakey() ((void)readakey())
74#define setakey(key) ((void)(__lastakey = (key)))
75#define setakeydo(todo) (__atodo = (todo))
76
77
78typedef int keytype;
79typedef void (*__atodotype)(void);
80#ifdef __cplusplus
81extern "C" {
82#endif
83
84extern __atodotype __atodo;
85
86extern keytype __lastakey;
87
88 extern keytype getakey(void);
89/* extern void setakey(keytype); */ /* MACRO */
90 extern keytype readakey(void);
91/* extern keytype lastakey(void); */ /* MACRO */
92/* extern void waitakey(void); */ /* MACRO */
93 extern int pressedakey(void);
94 extern void clearakeybuff(void);
95/* extern void setakeydo(dofn __atodotype); */ /* MACRO */
96 extern void ungetakey(void);
97 extern int insertakey(keytype key);
98 extern void setasmalldelay(int delay);
99
100 extern int initakey(void);
101 extern void closeakey(void);
102
103#ifdef __cplusplus
104}
105#endif
106
107
108#endif /* _AKEY_H */
109
110/* End of akey.h */
111