source: golgotha/src/i4/device/keys.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.2 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef __KEYS_HPP_
10#define __KEYS_HPP_
11
12#include "arch.hh"
13#include "string/string.hh"
14
15typedef w16 i4_key;
16
17enum i4_key_enum
18//{{{
19{
20  I4_NO_KEY        =0,
21  I4_BACKSPACE     =8,
22  I4_TAB           =9,
23  I4_ENTER        =13,
24  I4_ESC          =27,
25  I4_SPACE        =32,
26  I4_UP           =256,
27  I4_DOWN,
28  I4_LEFT,
29  I4_RIGHT,
30  I4_CTRL_L,
31  I4_CTRL_R,
32  I4_ALT_L,
33  I4_ALT_R,
34  I4_SHIFT_L,
35  I4_SHIFT_R,
36  I4_CAPS,
37  I4_NUM_LOCK,
38  I4_HOME,
39  I4_END,
40  I4_DEL,
41  I4_F1,
42  I4_F2,
43  I4_F3,
44  I4_F4,
45  I4_F5,
46  I4_F6,
47  I4_F7,
48  I4_F8,
49  I4_F9,
50  I4_F10,
51  I4_F11,
52  I4_F12,
53  I4_F13,
54  I4_F14,
55  I4_F15,
56  I4_INSERT,
57  I4_PAGEUP,
58  I4_PAGEDOWN,
59  I4_COMMAND,
60  I4_KP0,
61  I4_KP1,
62  I4_KP2,
63  I4_KP3,
64  I4_KP4,
65  I4_KP5,
66  I4_KP6,
67  I4_KP7,
68  I4_KP8,
69  I4_KP9,
70  I4_KPEQUAL,
71  I4_KPSLASH,
72  I4_KPSTAR,
73  I4_KPMINUS,
74  I4_KPPLUS,
75  I4_KPENTER,
76  I4_KPPERIOD,
77  I4_NUM_KEYS
78};
79//}}}
80
81enum i4_key_modifer_state
82{
83  I4_MODIFIER_SHIFT_L=1,
84  I4_MODIFIER_SHIFT_R=2,
85  I4_MODIFIER_SHIFT=1+2,
86
87  I4_MODIFIER_CTRL_L=4,
88  I4_MODIFIER_CTRL_R=8,
89  I4_MODIFIER_CTRL  =4+8,
90
91  I4_MODIFIER_ALT_L=16,
92  I4_MODIFIER_ALT_R=32,
93  I4_MODIFIER_ALT  =16+32,
94
95  I4_MODIFIER_WINDOWS=64,
96  I4_MODIFIER_CAPS=128,
97  I4_MODIFIER_NUMLOCK=256
98};
99
100i4_str *i4_key_name(i4_key key, w16 state);
101// returns a ASCII string describing a key, i.e. "Up Arrow"
102
103char *i4_get_key_name(i4_key key, i4_key state, char *buffer);
104// fills buffer with key name
105
106i4_bool i4_find_key(const i4_str& name, i4_key &key, w16 &mod);
107
108w16 i4_key_translate(i4_key raw_key, i4_bool press, w16 &state);
109// translates keypresses & shift states to standard input keys
110
111#endif
112
113//{{{ Emacs Locals
114// Local Variables:
115// folded-file: t
116// End:
117//}}}
Note: See TracBrowser for help on using the repository browser.