-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeys.h
81 lines (68 loc) · 2.19 KB
/
keys.h
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
/* keys.h - Zedit key code defines
* Copyright (C) 1988-2016 Sean MacLennan
*
* 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, or (at your option) any
* later version.
*
* 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 project; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _KEYS_H_
#define _KEYS_H_
#define CX(n) ((n) + 128)
#define M(n) ((n) + 256)
/* WIN32 needs these to fit in a byte */
#define TC_UP CX('a')
#define TC_DOWN CX('b')
#define TC_RIGHT CX('c')
#define TC_LEFT CX('d')
#define TC_INSERT CX('e')
#define TC_DELETE CX('f')
#define TC_PGUP CX('g')
#define TC_PGDOWN CX('h')
#define TC_HOME CX('i')
#define TC_END CX('j')
#define TC_F1 CX('k')
#define TC_F2 CX('l')
#define TC_F3 CX('m')
#define TC_F4 CX('n')
#define TC_F5 CX('o')
#define TC_F6 CX('p')
#define TC_F7 CX('q')
#define TC_F8 CX('r')
#define TC_F9 CX('s')
#define TC_F10 CX('t')
#define TC_F11 CX('u')
#define TC_F12 CX('v')
#define TC_C_HOME CX('w')
#define TC_C_END CX('x')
/* Unknown key - always bound to Znotimpl */
#define TC_UNKNOWN CX('z')
#define KEY_MASK 0x00ffffff
#define SPECIAL_START TC_UP
#define SPECIAL_END TC_C_END
#define NUM_SPECIAL (SPECIAL_END - SPECIAL_START + 1)
/* 128 ASCII + 128 meta + 128 C-X */
#define NUMKEYS (128 + 128 + 128)
/* kbd.c */
void tkbdinit(void);
int tgetkb(void);
int tkbrdy(void);
int tdelay(int ms);
void termcap_keys(void);
#ifdef WIN32
/* This mask defines which events are sent to the winkbd_event_cb */
#define WINKBD_EVENT_MASK (ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT)
/* Return non-zero if you don't want tgetkb to handle the event */
extern int (*winkbd_event_cb)(INPUT_RECORD *event);
#endif
#endif