forked from troglobit/MicroEMACS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ebind.h
231 lines (219 loc) · 6.19 KB
/
ebind.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/* EBIND: Initial default key to function bindings for
MicroEMACS 3.2
written by Dave G. Conroy
modified by Steve Wilhite, George Jones
greatly modified by Daniel Lawrence
*/
/*
* Command table.
* This table is *roughly* in ASCII order, left to right across the
* characters of the command. This expains the funny location of the
* control-X commands.
*/
KEYTAB keytab[NBINDS] = {
{CTRL|'A', gotobol},
{CTRL|'B', backchar},
{CTRL|'C', insspace},
{CTRL|'D', forwdel},
{CTRL|'E', gotoeol},
{CTRL|'F', forwchar},
{CTRL|'G', ctrlg},
{CTRL|'H', backdel},
{CTRL|'I', tab},
{CTRL|'J', indent},
{CTRL|'K', killtext},
{CTRL|'L', refresh},
{CTRL|'M', newline},
{CTRL|'N', forwline},
{CTRL|'O', openline},
{CTRL|'P', backline},
{CTRL|'Q', quote},
{CTRL|'R', backsearch},
{CTRL|'S', forwsearch},
{CTRL|'T', twiddle},
{CTRL|'V', forwpage},
{CTRL|'W', killregion},
{CTRL|'Y', yank},
{CTRL|'Z', backpage},
{CTLX|CTRL|'B', listbuffers},
{CTLX|CTRL|'C', quit}, /* Hard quit. */
{CTLX|CTRL|'F', filefind},
{CTLX|CTRL|'I', insfile},
{CTLX|CTRL|'L', lowerregion},
{CTLX|CTRL|'M', delmode},
{CTLX|CTRL|'N', mvdnwind},
{CTLX|CTRL|'O', deblank},
{CTLX|CTRL|'P', mvupwind},
{CTLX|CTRL|'R', fileread},
{CTLX|CTRL|'S', filesave},
{CTLX|CTRL|'U', upperregion},
{CTLX|CTRL|'V', viewfile},
{CTLX|CTRL|'W', filewrite},
{CTLX|CTRL|'X', swapmark},
{CTLX|CTRL|'Z', shrinkwind},
{CTLX|'?', deskey},
{CTLX|'!', spawn}, /* Run 1 command. */
{CTLX|'=', showcpos},
{CTLX|'(', ctlxlp},
{CTLX|')', ctlxrp},
{CTLX|'^', enlargewind},
{CTLX|'1', onlywind},
{CTLX|'2', splitwind},
{CTLX|'B', usebuffer},
{CTLX|'C', spawncli}, /* Run CLI in subjob. */
#if V7 & BSD
{CTLX|'D', bktoshell}, /* suspend emacs */
#endif
{CTLX|'E', ctlxe},
{CTLX|'F', setfillcol},
{CTLX|'K', killbuffer},
{CTLX|'M', setmode},
{CTLX|'N', filename},
{CTLX|'O', nextwind},
{CTLX|'P', prevwind},
{CTLX|'S', filesave},
{CTLX|'X', nextbuffer},
{CTLX|'Z', enlargewind},
{META|CTRL|'H', delbword},
{META|CTRL|'K', unbindkey},
{META|CTRL|'L', reposition},
{META|CTRL|'M', delgmode},
{META|CTRL|'N', namebuffer},
{META|CTRL|'R', qreplace},
{META|CTRL|'V', scrnextdw},
{META|CTRL|'W', killpara},
{META|CTRL|'Z', scrnextup},
{META|' ', setmark},
{META|'?', help},
{META|'!', reposition},
{META|'.', setmark},
{META|'>', gotoeob},
{META|'<', gotobob},
{META|'B', backword},
{META|'C', capword},
{META|'D', delfword},
{META|'F', forwword},
{META|'G', gotoline},
{META|'K', bindtokey},
{META|'L', lowerword},
{META|'M', setgmode},
{META|'N', gotoeop},
{META|'P', gotobop},
{META|'Q', fillpara},
{META|'R', sreplace},
#if V7 & BSD
{META|'S', bktoshell},
#endif
{META|'U', upperword},
{META|'V', backpage},
{META|'W', copyregion},
{META|'X', namedcmd},
{META|'Z', quickexit},
{META|0x7F, delbword},
#if MSDOS & (HP150 == 0)
{SPEC|CTRL|'_', forwhunt},
{SPEC|CTRL|'S', backhunt},
{SPEC|71, gotobob},
{SPEC|72, backline},
{SPEC|73, backpage},
{SPEC|75, backchar},
{SPEC|77, forwchar},
{SPEC|79, gotoeob},
{SPEC|80, forwline},
{SPEC|81, forwpage},
{SPEC|82, insspace},
{SPEC|83, forwdel},
{SPEC|115, backword},
{SPEC|116, forwword},
{SPEC|132, gotobop},
{SPEC|118, gotoeop},
#endif
#if HP150
{SPEC|32, backline},
{SPEC|33, forwline},
{SPEC|35, backchar},
{SPEC|34, forwchar},
{SPEC|44, gotobob},
{SPEC|46, forwpage},
{SPEC|47, backpage},
{SPEC|82, nextwind},
{SPEC|68, openline},
{SPEC|69, killtext},
{SPEC|65, forwdel},
{SPEC|64, ctlxe},
{SPEC|67, refresh},
{SPEC|66, reposition},
{SPEC|83, help},
{SPEC|81, deskey},
#endif
#if AMIGA
{SPEC|'?', help},
{SPEC|'A', backline},
{SPEC|'B', forwline},
{SPEC|'C', forwchar},
{SPEC|'D', backchar},
{SPEC|'T', backpage},
{SPEC|'S', forwpage},
{SPEC|'a', backword},
{SPEC|'`', forwword},
#endif
{0x7F, backdel},
{0, NULL}
};
#if RAINBOW
#include "rainbow.h"
/*
* Mapping table from the LK201 function keys to the internal EMACS character.
*/
short lk_map[][2] = {
Up_Key, CTRL+'P',
Down_Key, CTRL+'N',
Left_Key, CTRL+'B',
Right_Key, CTRL+'F',
Shift+Left_Key, META+'B',
Shift+Right_Key, META+'F',
Control+Left_Key, CTRL+'A',
Control+Right_Key, CTRL+'E',
Prev_Scr_Key, META+'V',
Next_Scr_Key, CTRL+'V',
Shift+Up_Key, META+'<',
Shift+Down_Key, META+'>',
Cancel_Key, CTRL+'G',
Find_Key, CTRL+'S',
Shift+Find_Key, CTRL+'R',
Insert_Key, CTRL+'Y',
Options_Key, CTRL+'D',
Shift+Options_Key, META+'D',
Remove_Key, CTRL+'W',
Shift+Remove_Key, META+'W',
Select_Key, CTRL+'@',
Shift+Select_Key, CTLX+CTRL+'X',
Interrupt_Key, CTRL+'U',
Keypad_PF2, META+'L',
Keypad_PF3, META+'C',
Keypad_PF4, META+'U',
Shift+Keypad_PF2, CTLX+CTRL+'L',
Shift+Keypad_PF4, CTLX+CTRL+'U',
Keypad_1, CTLX+'1',
Keypad_2, CTLX+'2',
Do_Key, CTLX+'E',
Keypad_4, CTLX+CTRL+'B',
Keypad_5, CTLX+'B',
Keypad_6, CTLX+'K',
Resume_Key, META+'!',
Control+Next_Scr_Key, CTLX+'N',
Control+Prev_Scr_Key, CTLX+'P',
Control+Up_Key, CTLX+CTRL+'P',
Control+Down_Key, CTLX+CTRL+'N',
Help_Key, CTLX+'=',
Shift+Do_Key, CTLX+'(',
Control+Do_Key, CTLX+')',
Keypad_0, CTLX+'Z',
Shift+Keypad_0, CTLX+CTRL+'Z',
Main_Scr_Key, CTRL+'C',
Keypad_Enter, CTLX+'!',
Exit_Key, CTLX+CTRL+'C',
Shift+Exit_Key, CTRL+'Z'
};
#define lk_map_size (sizeof(lk_map)/2)
#endif