File: akey.h

package info (click to toggle)
spectemu 0.94a-20
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye, buster
  • size: 1,300 kB
  • sloc: ansic: 15,421; asm: 5,160; sh: 1,533; cpp: 377; makefile: 173
file content (111 lines) | stat: -rw-r--r-- 3,219 bytes parent folder | download | duplicates (11)
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
/* 
 * Copyright (C) 1996-1998 Szeredi Miklos
 * Email: mszeredi@inf.bme.hu
 *
 * This program 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. See the file COPYING. 
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

/*             akey.h
 *
 *     Header of the AKEY module
 *
 *     Keyboard handeling routines and key identification labels
 *
 *     Created:   92/12/01    Szeredi Miklos
 */


#ifndef _AKEY_H
#define _AKEY_H


#define  NOKEY           -1
#define  UNKNOWNKEY      -2
#define  ERRKEY          -3
#define  MOUSEKEY        -256

#define  UPKEY           (256 + 1)
#define  DOWNKEY         (256 + 2)
#define  RIGHTKEY        (256 + 3)
#define  LEFTKEY         (256 + 4)
#define  INSKEY          (256 + 5)
#define  DELKEY          (256 + 6)
#define  HOMEKEY         (256 + 7)
#define  ENDKEY          (256 + 8)
#define  PUKEY           (256 + 9)
#define  PDKEY           (256 + 10)
#define  BSKEY           (256 + 16)

#define  FKEYOFFS        (256 + 128)
#define  FKEYFIRST       (FKEYOFFS + 1)
#define  FKEYLAST        (FKEYOFFS + 12)
#define  FKEY(num)       (FKEYOFFS + num)

#define  ALTKEY          (1 << 11)
#define  CTRKEY          (1 << 10)
#define  SHKEY           (1 << 9)

#define  BKTABKEY        (TABKEY | SHKEY)

#define  CTL(ch)         ((ch) - 96)
#define  META(ch)        ((ch) | ALTKEY)

#define  TABKEY          9
#define  LFKEY           13 
#define  CRKEY           10
#define  ENTERKEY        LFKEY
#define  ESCKEY          27

#define  lastakey()      __lastakey
#define  waitakey()      ((void)readakey())
#define  setakey(key)    ((void)(__lastakey = (key)))
#define  setakeydo(todo) (__atodo = (todo))


typedef  int             keytype;
typedef  void            (*__atodotype)(void);
#ifdef __cplusplus
extern "C" {
#endif

extern   __atodotype      __atodo;

extern   keytype         __lastakey;

   extern   keytype         getakey(void);
/* extern   void            setakey(keytype);    */ /* MACRO */
   extern   keytype         readakey(void);
/* extern   keytype         lastakey(void);      */ /* MACRO */
/* extern   void            waitakey(void);      */ /* MACRO */
   extern   int             pressedakey(void);
   extern   void            clearakeybuff(void);
/* extern   void            setakeydo(dofn __atodotype); */ /* MACRO */
   extern   void            ungetakey(void);
   extern   int             insertakey(keytype key);
   extern   void            setasmalldelay(int delay);

   extern   int             initakey(void);
   extern   void            closeakey(void);

#ifdef __cplusplus
}
#endif


#endif /* _AKEY_H */

/*         End of akey.h                 */