PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plevent.h
Go to the documentation of this file.
1 // Input event (especially keyboard) definitions for use from plplot
2 // event handlers.
3 //
4 // Key definitions are taken from the X11/keysymdef.h include file, with
5 // some changes:
6 // - only the control keys are retained
7 // - the XK prefix has been changed to PLK
8 // - control keys with ASCII equivalents use the ASCII code
9 //
10 // By using the ASCII equivalent (if it exists) for all control keys, it
11 // is easier to handle keyboard input from any device which is ASCII based.
12 // Devices which use some other kind of key encoding must translate the raw
13 // keycodes to those used here.
14 //
15 
16 #ifndef __PLEVENT_H__
17 #define __PLEVENT_H__
18 
19 // Key definitions
20 
21 //--------------------------------------------------------------------------
22 // Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
23 // and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
24 //
25 // All Rights Reserved
26 //
27 // Permission to use, copy, modify, and distribute this software and its
28 // documentation for any purpose and without fee is hereby granted,
29 // provided that the above copyright notice appear in all copies and that
30 // both that copyright notice and this permission notice appear in
31 // supporting documentation, and that the names of Digital or MIT not be
32 // used in advertising or publicity pertaining to distribution of the
33 // software without specific, written prior permission.
34 //
35 // DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
36 // ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
37 // DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
38 // ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
39 // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
40 // ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
41 // SOFTWARE.
42 //
43 //--------------------------------------------------------------------------
44 
45 // Miscellaneous control keys, those with ASCII equivalents
46 
47 #define PLK_BackSpace 0x08 // back space, back char
48 #define PLK_Tab 0x09
49 #define PLK_Linefeed 0x0A // Linefeed, LF
50 #define PLK_Return 0x0D // Return, enter
51 #define PLK_Escape 0x1B
52 #define PLK_Delete 0xFF // Delete, rubout
53 
54 // Those without ASCII equivalents
55 
56 #define PLK_Clear 0xFF0B
57 #define PLK_Pause 0xFF13 // Pause, hold
58 #define PLK_Scroll_Lock 0xFF14
59 
60 // Cursor control & motion
61 
62 #define PLK_Home 0xFF50
63 #define PLK_Left 0xFF51 // Move left, left arrow
64 #define PLK_Up 0xFF52 // Move up, up arrow
65 #define PLK_Right 0xFF53 // Move right, right arrow
66 #define PLK_Down 0xFF54 // Move down, down arrow
67 #define PLK_Prior 0xFF55 // Prior, previous (Page Up)
68 #define PLK_Next 0xFF56 // Next (Page Down)
69 #define PLK_End 0xFF57 // EOL
70 #define PLK_Begin 0xFF58 // BOL
71 
72 // Misc Functions
73 
74 #define PLK_Select 0xFF60 // Select, mark
75 #define PLK_Print 0xFF61
76 #define PLK_Execute 0xFF62 // Execute, run, do
77 #define PLK_Insert 0xFF63 // Insert, insert here
78 #define PLK_Undo 0xFF65 // Undo, oops
79 #define PLK_Redo 0xFF66 // redo, again
80 #define PLK_Menu 0xFF67
81 #define PLK_Find 0xFF68 // Find, search
82 #define PLK_Cancel 0xFF69 // Cancel, stop, abort, exit
83 #define PLK_Help 0xFF6A // Help, ?
84 #define PLK_Break 0xFF6B
85 #define PLK_Mode_switch 0xFF7E // Character set switch
86 #define PLK_script_switch 0xFF7E // Alias for mode_switch
87 #define PLK_Num_Lock 0xFF7F
88 
89 // Keypad Functions, keypad numbers cleverly chosen to map to ascii
90 
91 #define PLK_KP_Space 0xFF80 // space
92 #define PLK_KP_Tab 0xFF89
93 #define PLK_KP_Enter 0xFF8D // enter
94 #define PLK_KP_F1 0xFF91 // PF1, KP_A, ...
95 #define PLK_KP_F2 0xFF92
96 #define PLK_KP_F3 0xFF93
97 #define PLK_KP_F4 0xFF94
98 #define PLK_KP_Equal 0xFFBD // equals
99 #define PLK_KP_Multiply 0xFFAA
100 #define PLK_KP_Add 0xFFAB
101 #define PLK_KP_Separator 0xFFAC // separator, often comma
102 #define PLK_KP_Subtract 0xFFAD
103 #define PLK_KP_Decimal 0xFFAE
104 #define PLK_KP_Divide 0xFFAF
105 
106 #define PLK_KP_0 0xFFB0
107 #define PLK_KP_1 0xFFB1
108 #define PLK_KP_2 0xFFB2
109 #define PLK_KP_3 0xFFB3
110 #define PLK_KP_4 0xFFB4
111 #define PLK_KP_5 0xFFB5
112 #define PLK_KP_6 0xFFB6
113 #define PLK_KP_7 0xFFB7
114 #define PLK_KP_8 0xFFB8
115 #define PLK_KP_9 0xFFB9
116 
117 //
118 // Auxilliary Functions; note the duplicate definitions for left and right
119 // function keys; Sun keyboards and a few other manufactures have such
120 // function key groups on the left and/or right sides of the keyboard.
121 // We've not found a keyboard with more than 35 function keys total.
122 //
123 
124 #define PLK_F1 0xFFBE
125 #define PLK_F2 0xFFBF
126 #define PLK_F3 0xFFC0
127 #define PLK_F4 0xFFC1
128 #define PLK_F5 0xFFC2
129 #define PLK_F6 0xFFC3
130 #define PLK_F7 0xFFC4
131 #define PLK_F8 0xFFC5
132 #define PLK_F9 0xFFC6
133 #define PLK_F10 0xFFC7
134 #define PLK_F11 0xFFC8
135 #define PLK_L1 0xFFC8
136 #define PLK_F12 0xFFC9
137 #define PLK_L2 0xFFC9
138 #define PLK_F13 0xFFCA
139 #define PLK_L3 0xFFCA
140 #define PLK_F14 0xFFCB
141 #define PLK_L4 0xFFCB
142 #define PLK_F15 0xFFCC
143 #define PLK_L5 0xFFCC
144 #define PLK_F16 0xFFCD
145 #define PLK_L6 0xFFCD
146 #define PLK_F17 0xFFCE
147 #define PLK_L7 0xFFCE
148 #define PLK_F18 0xFFCF
149 #define PLK_L8 0xFFCF
150 #define PLK_F19 0xFFD0
151 #define PLK_L9 0xFFD0
152 #define PLK_F20 0xFFD1
153 #define PLK_L10 0xFFD1
154 #define PLK_F21 0xFFD2
155 #define PLK_R1 0xFFD2
156 #define PLK_F22 0xFFD3
157 #define PLK_R2 0xFFD3
158 #define PLK_F23 0xFFD4
159 #define PLK_R3 0xFFD4
160 #define PLK_F24 0xFFD5
161 #define PLK_R4 0xFFD5
162 #define PLK_F25 0xFFD6
163 #define PLK_R5 0xFFD6
164 #define PLK_F26 0xFFD7
165 #define PLK_R6 0xFFD7
166 #define PLK_F27 0xFFD8
167 #define PLK_R7 0xFFD8
168 #define PLK_F28 0xFFD9
169 #define PLK_R8 0xFFD9
170 #define PLK_F29 0xFFDA
171 #define PLK_R9 0xFFDA
172 #define PLK_F30 0xFFDB
173 #define PLK_R10 0xFFDB
174 #define PLK_F31 0xFFDC
175 #define PLK_R11 0xFFDC
176 #define PLK_F32 0xFFDD
177 #define PLK_R12 0xFFDD
178 #define PLK_R13 0xFFDE
179 #define PLK_F33 0xFFDE
180 #define PLK_F34 0xFFDF
181 #define PLK_R14 0xFFDF
182 #define PLK_F35 0xFFE0
183 #define PLK_R15 0xFFE0
184 
185 // Modifiers
186 
187 #define PLK_Shift_L 0xFFE1 // Left shift
188 #define PLK_Shift_R 0xFFE2 // Right shift
189 #define PLK_Control_L 0xFFE3 // Left control
190 #define PLK_Control_R 0xFFE4 // Right control
191 #define PLK_Caps_Lock 0xFFE5 // Caps lock
192 #define PLK_Shift_Lock 0xFFE6 // Shift lock
193 
194 #define PLK_Meta_L 0xFFE7 // Left meta
195 #define PLK_Meta_R 0xFFE8 // Right meta
196 #define PLK_Alt_L 0xFFE9 // Left alt
197 #define PLK_Alt_R 0xFFEA // Right alt
198 #define PLK_Super_L 0xFFEB // Left super
199 #define PLK_Super_R 0xFFEC // Right super
200 #define PLK_Hyper_L 0xFFED // Left hyper
201 #define PLK_Hyper_R 0xFFEE // Right hyper
202 
203 #endif // __PLEVENT_H__