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 #ifdef HAVE_CONFIG_H
28 #include "../config.h"
29 #endif
30
31 #include "text.h"
32 #include "textP.h"
33 #include "textBuf.h"
34 #include "textDisp.h"
35 #include "textSel.h"
36 #include "textDrag.h"
37 #include "nedit.h"
38 #include "calltips.h"
39 #include "../util/DialogF.h"
40 #include "../util/xdnd.h"
41 #include "window.h"
42 #include "preferences.h"
43 #include "../util/nedit_malloc.h"
44 #include "help.h"
45
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <limits.h>
49 #include <string.h>
50 #include <ctype.h>
51 #include <sys/param.h>
52 #include <limits.h>
53
54 #include <X11/Intrinsic.h>
55 #include <X11/IntrinsicP.h>
56 #include <X11/StringDefs.h>
57 #include <X11/cursorfont.h>
58 #include <Xm/Xm.h>
59 #include <Xm/XmP.h>
60 #if XmVersion >=
1002
61 #include <Xm/PrimitiveP.h>
62 #endif
63
64 #ifndef XK_Control_L
65 #include <X11/keysym.h>
66 #endif
67
68 #ifdef HAVE_DEBUG_H
69 #include "../debug.h"
70 #endif
71
72
73 #ifdef UNICOS
74 #define XtOffset(p_type,field) ((
size_t)
__INTADDR__(&(((p_type)
0)->field)))
75 #endif
76
77
78
79
80 #define SELECT_THRESHOLD 5
81
82
83 #define VERTICAL_SCROLL_DELAY 50
84
85 static void initialize(TextWidget request, TextWidget new);
86 static void handleHidePointer(Widget w, XtPointer unused,
87 XEvent *event, Boolean *continue_to_dispatch);
88 static void handleShowPointer(Widget w, XtPointer unused,
89 XEvent *event, Boolean *continue_to_dispatch);
90 static void redisplay(TextWidget w, XEvent *event, Region region);
91 static void redisplayGE(TextWidget w, XtPointer client_data,
92 XEvent *event, Boolean *continue_to_dispatch_return);
93 static void hscrollEH(TextWidget w, XtPointer client_data,
94 XEvent *event, Boolean *continue_to_dispatch_return);
95 static void destroy(TextWidget w);
96 static void resize(TextWidget w);
97 static Boolean setValues(TextWidget current, TextWidget request,
98 TextWidget new);
99 static void realize(Widget w, XtValueMask *valueMask,
100 XSetWindowAttributes *attributes);
101 static XtGeometryResult queryGeometry(Widget w, XtWidgetGeometry *proposed,
102 XtWidgetGeometry *answer);
103 static void grabFocusAP(Widget w, XEvent *event, String *args,
104 Cardinal *n_args);
105 static void cancelAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
106 static void moveDestinationAP(Widget w, XEvent *event, String *args,
107 Cardinal *nArgs);
108 static void extendAdjustAP(Widget w, XEvent *event, String *args,
109 Cardinal *nArgs);
110 static void extendStartAP(Widget w, XEvent *event, String *args,
111 Cardinal *nArgs);
112 static void extendEndAP(Widget w, XEvent *event, String *args,
113 Cardinal *nArgs);
114 static void processCancelAP(Widget w, XEvent *event, String *args,
115 Cardinal *nArgs);
116 static void secondaryStartAP(Widget w, XEvent *event, String *args,
117 Cardinal *nArgs);
118 static void secondaryOrDragStartAP(Widget w, XEvent *event, String *args,
119 Cardinal *nArgs);
120 static void secondaryAdjustAP(Widget w, XEvent *event, String *args,
121 Cardinal *nArgs);
122 static void secondaryOrDragAdjustAP(Widget w, XEvent *event, String *args,
123 Cardinal *nArgs);
124 static void copyToAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
125 static void copyToOrEndDragAP(Widget w, XEvent *event, String *args,
126 Cardinal *nArgs);
127 static void copyPrimaryAP(Widget w, XEvent *event, String *args,
128 Cardinal *nArgs);
129 static void cutPrimaryAP(Widget w, XEvent *event, String *args,
130 Cardinal *nArgs);
131 static void moveToAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
132 static void moveToOrEndDragAP(Widget w, XEvent *event, String *args,
133 Cardinal *nArgs);
134 static void endDragAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
135 static void exchangeAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
136 static void mousePanAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
137 static void pasteClipboardAP(Widget w, XEvent *event, String *args,
138 Cardinal *nArgs);
139 static void copyClipboardAP(Widget w, XEvent *event, String *args,
140 Cardinal *nArgs);
141 static void cutClipboardAP(Widget w, XEvent *event, String *args,
142 Cardinal *nArgs);
143 static void insertStringAP(Widget w, XEvent *event, String *args,
144 Cardinal *nArgs);
145 static void selfInsertAP(Widget w, XEvent *event, String *args,
146 Cardinal *n_args);
147 static void newlineAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
148 static void newlineAndIndentAP(Widget w, XEvent *event, String *args,
149 Cardinal *nArgs);
150 static void newlineNoIndentAP(Widget w, XEvent *event, String *args,
151 Cardinal *nArgs);
152 static void processTabAP(Widget w, XEvent *event, String *args,
153 Cardinal *nArgs);
154 static void endOfLineAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
155 static void beginningOfLineAP(Widget w, XEvent *event, String *args,
156 Cardinal *nArgs);
157 static void deleteSelectionAP(Widget w, XEvent *event, String *args,
158 Cardinal *nArgs);
159 static void deletePreviousCharacterAP(Widget w, XEvent *event, String *args,
160 Cardinal *nArgs);
161 static void deleteNextCharacterAP(Widget w, XEvent *event, String *args,
162 Cardinal *nArgs);
163 static void deletePreviousWordAP(Widget w, XEvent *event, String *args,
164 Cardinal *nArgs);
165 static void deleteNextWordAP(Widget w, XEvent *event, String *args,
166 Cardinal *nArgs);
167 static void deleteToStartOfLineAP(Widget w, XEvent *event, String *args,
168 Cardinal *nArgs);
169 static void deleteToEndOfLineAP(Widget w, XEvent *event, String *args,
170 Cardinal *nArgs);
171 static void forwardCharacterAP(Widget w, XEvent *event, String *args,
172 Cardinal *nArgs);
173 static void backwardCharacterAP(Widget w, XEvent *event, String *args,
174 Cardinal *nArgs);
175 static void forwardWordAP(Widget w, XEvent *event, String *args,
176 Cardinal *nArgs);
177 static void backwardWordAP(Widget w, XEvent *event, String *args,
178 Cardinal *nArgs);
179 static void forwardParagraphAP(Widget w, XEvent *event, String *args,
180 Cardinal *nArgs);
181 static void backwardParagraphAP(Widget w, XEvent *event, String *args,
182 Cardinal *nArgs);
183 static void keySelectAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
184 static void processUpAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
185 static void processShiftUpAP(Widget w, XEvent *event, String *args,
186 Cardinal *nArgs);
187 static void processDownAP(Widget w, XEvent *event, String *args,
188 Cardinal *nArgs);
189 static void processShiftDownAP(Widget w, XEvent *event, String *args,
190 Cardinal *nArgs);
191 static void beginningOfFileAP(Widget w, XEvent *event, String *args,
192 Cardinal *nArgs);
193 static void endOfFileAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
194 static void nextPageAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
195 static void previousPageAP(Widget w, XEvent *event, String *args,
196 Cardinal *nArgs);
197 static void pageLeftAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
198 static void pageRightAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
199 static void toggleOverstrikeAP(Widget w, XEvent *event, String *args,
200 Cardinal *nArgs);
201 static void scrollUpAP(Widget w, XEvent *event, String *args,
202 Cardinal *nArgs);
203 static void scrollDownAP(Widget w, XEvent *event, String *args,
204 Cardinal *nArgs);
205 static void scrollLeftAP(Widget w, XEvent *event, String *args,
206 Cardinal *nArgs);
207 static void scrollRightAP(Widget w, XEvent *event, String *args,
208 Cardinal *nArgs);
209 static void scrollToLineAP(Widget w, XEvent *event, String *args,
210 Cardinal *nArgs);
211 static void selectAllAP(Widget w, XEvent *event, String *args,
212 Cardinal *nArgs);
213 static void deselectAllAP(Widget w, XEvent *event, String *args,
214 Cardinal *nArgs);
215 static void focusInAP(Widget w, XEvent *event, String *args,
216 Cardinal *nArgs);
217 static void focusOutAP(Widget w, XEvent *event, String *args,
218 Cardinal *nArgs);
219 static void zoomInAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
220 static void zoomOutAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
221 #ifndef DISABLE_MULTICURSOR
222 static void addCursorUpAP(Widget w, XEvent *event, String *args,
223 Cardinal *nArgs);
224 static void addCursorDownAP(Widget w, XEvent *event, String *args,
225 Cardinal *nArgs);
226 #endif
227
228 static void checkMoveSelectionChange(Widget w, XEvent *event,
int startPos,
229 String *args, Cardinal *nArgs);
230 static void keyMoveExtendSelection(Widget w, XEvent *event,
int startPos,
231 int rectangular);
232 static void checkAutoShowInsertPos(Widget w);
233 static int checkReadOnly(Widget w);
234 static void simpleInsertAtCursor(Widget w,
char *chars, XEvent *event,
235 int allowPendingDelete);
236 static int pendingSelection(Widget w);
237 static int deletePendingSelection(Widget w, XEvent *event);
238 static int deleteEmulatedTab(Widget w, XEvent *event);
239 static void selectWord(Widget w,
int pointerX);
240 static int spanForward(textBuffer *buf,
int startPos,
char *searchChars,
241 int ignoreSpace,
int *foundPos);
242 static int spanBackward(textBuffer *buf,
int startPos,
char *searchChars,
int
243 ignoreSpace,
int *foundPos);
244 static void selectLine(Widget w);
245 static int startOfWord(TextWidget w,
int pos);
246 static int endOfWord(TextWidget w,
int pos);
247 static void checkAutoScroll(TextWidget w,
int x,
int y);
248 static void endDrag(Widget w);
249 static void cancelDrag(Widget w);
250 static void callCursorMovementCBs(Widget w, XEvent *event);
251 static void adjustSelection(TextWidget tw,
int x,
int y);
252 static void adjustSecondarySelection(TextWidget tw,
int x,
int y);
253 static void autoScrollTimerProc(XtPointer clientData, XtIntervalId *id);
254 static char *wrapText(TextWidget tw,
char *startLine,
char *text,
int bufOffset,
255 int wrapMargin,
int *breakBefore);
256 static int wrapLine(TextWidget tw, textBuffer *buf,
int bufOffset,
257 int lineStartPos,
int lineEndPos,
int limitPos,
int *breakAt,
258 int *charsAdded);
259 static char *createIndentString(TextWidget tw, textBuffer *buf,
int bufOffset,
260 int lineStartPos,
int lineEndPos,
int *length,
int *column);
261 static void cursorBlinkTimerProc(XtPointer clientData, XtIntervalId *id);
262 static int hasKey(
const char *key,
const String *args,
const Cardinal *nArgs);
263 static int max(
int i1,
int i2);
264 static int min(
int i1,
int i2);
265 static void ringIfNecessary(Boolean silent, Widget w);
266
267 static XftColor defaultAnsiColors[
16];
268
269 static char defaultTranslations[] =
270
271 "~Shift ~Ctrl Alt<Key>osfBeginLine: last_document()\n"
272
273 "<KeyPress>osfCancel: cancel()\n"
274 "Alt<KeyPress>osfCancel: cancel()\n"
275
276
277 ":<Key>KP_7: self_insert()\n"
278 ":<Key>KP_8: self_insert()\n"
279 ":<Key>KP_9: self_insert()\n"
280 ":<Key>KP_4: self_insert()\n"
281 ":<Key>KP_6: self_insert()\n"
282 ":<Key>KP_1: self_insert()\n"
283 ":<Key>KP_2: self_insert()\n"
284 ":<Key>KP_3: self_insert()\n"
285 ":<Key>KP_0: self_insert()\n"
286 ":<Key>KP_Separator: self_insert()\n"
287
288
289 "Ctrl<KeyPress>osfBackSpace: delete_previous_word()\n"
290 "<KeyPress>osfBackSpace: delete_previous_character()\n"
291
292
293 "Alt Shift Ctrl<KeyPress>osfDelete: cut_primary(\"rect\")\n"
294 "Meta Shift Ctrl<KeyPress>osfDelete: cut_primary(\"rect\")\n"
295 "Shift Ctrl<KeyPress>osfDelete: cut_primary()\n"
296 "Ctrl<KeyPress>osfDelete: delete_to_end_of_line()\n"
297 "Shift<KeyPress>osfDelete: cut_clipboard()\n"
298 "<KeyPress>osfDelete: delete_next_character()\n"
299
300
301 "Alt Shift Ctrl<KeyPress>osfInsert: copy_primary(\"rect\")\n"
302 "Meta Shift Ctrl<KeyPress>osfInsert: copy_primary(\"rect\")\n"
303 "Shift Ctrl<KeyPress>osfInsert: copy_primary()\n"
304 "Shift<KeyPress>osfInsert: paste_clipboard()\n"
305 "Ctrl<KeyPress>osfInsert: copy_clipboard()\n"
306 "~Shift ~Ctrl<KeyPress>osfInsert: set_overtype_mode()\n"
307
308
309 "Shift Ctrl<KeyPress>osfCut: cut_primary()\n"
310 "<KeyPress>osfCut: cut_clipboard()\n"
311 "<KeyPress>osfCopy: copy_clipboard()\n"
312 "<KeyPress>osfPaste: paste_clipboard()\n"
313 "<KeyPress>osfPrimaryPaste: copy_primary()\n"
314
315
316 "Alt Shift Ctrl<KeyPress>osfBeginLine: beginning_of_file(\"extend\", \"rect\")\n"
317 "Meta Shift Ctrl<KeyPress>osfBeginLine: beginning_of_file(\"extend\" \"rect\")\n"
318 "Alt Shift<KeyPress>osfBeginLine: beginning_of_line(\"extend\", \"rect\")\n"
319 "Meta Shift<KeyPress>osfBeginLine: beginning_of_line(\"extend\", \"rect\")\n"
320 "Shift Ctrl<KeyPress>osfBeginLine: beginning_of_file(\"extend\")\n"
321 "Ctrl<KeyPress>osfBeginLine: beginning_of_file()\n"
322 "Shift<KeyPress>osfBeginLine: beginning_of_line(\"extend\")\n"
323 "~Alt~Shift~Ctrl~Meta<KeyPress>osfBeginLine: beginning_of_line()\n"
324
325
326 "Alt Shift Ctrl<KeyPress>osfEndLine: end_of_file(\"extend\", \"rect\")\n"
327 "Meta Shift Ctrl<KeyPress>osfEndLine: end_of_file(\"extend\", \"rect\")\n"
328 "Alt Shift<KeyPress>osfEndLine: end_of_line(\"extend\", \"rect\")\n"
329 "Meta Shift<KeyPress>osfEndLine: end_of_line(\"extend\", \"rect\")\n"
330 "Shift Ctrl<KeyPress>osfEndLine: end_of_file(\"extend\")\n"
331 "Ctrl<KeyPress>osfEndLine: end_of_file()\n"
332 "Shift<KeyPress>osfEndLine: end_of_line(\"extend\")\n"
333 "~Alt~Shift~Ctrl~Meta<KeyPress>osfEndLine: end_of_line()\n"
334
335
336 "Alt Shift Ctrl<KeyPress>osfLeft: backward_word(\"extend\", \"rect\")\n"
337 "Meta Shift Ctrl<KeyPress>osfLeft: backward_word(\"extend\", \"rect\")\n"
338 "Alt Shift<KeyPress>osfLeft: key_select(\"left\", \"rect\")\n"
339 "Meta Shift<KeyPress>osfLeft: key_select(\"left\", \"rect\")\n"
340 "Shift Ctrl<KeyPress>osfLeft: backward_word(\"extend\")\n"
341 "Ctrl<KeyPress>osfLeft: backward_word()\n"
342 "Shift<KeyPress>osfLeft: key_select(\"left\")\n"
343 "~Alt~Shift~Ctrl~Meta<KeyPress>osfLeft: backward_character()\n"
344
345
346 "Alt Shift Ctrl<KeyPress>osfRight: forward_word(\"extend\", \"rect\")\n"
347 "Meta Shift Ctrl<KeyPress>osfRight: forward_word(\"extend\", \"rect\")\n"
348 "Alt Shift<KeyPress>osfRight: key_select(\"right\", \"rect\")\n"
349 "Meta Shift<KeyPress>osfRight: key_select(\"right\", \"rect\")\n"
350 "Shift Ctrl<KeyPress>osfRight: forward_word(\"extend\")\n"
351 "Ctrl<KeyPress>osfRight: forward_word()\n"
352 "Shift<KeyPress>osfRight: key_select(\"right\")\n"
353 "~Alt~Shift~Ctrl~Meta<KeyPress>osfRight: forward_character()\n"
354
355
356 #ifndef DISABLE_MULTICURSOR
357 "Ctrl Super<KeyPress>osfUp: add_cursor_up()\n"
358 #endif
359 "Alt Shift Ctrl<KeyPress>osfUp: backward_paragraph(\"extend\", \"rect\")\n"
360 "Meta Shift Ctrl<KeyPress>osfUp: backward_paragraph(\"extend\", \"rect\")\n"
361 "Alt Shift<KeyPress>osfUp: process_shift_up(\"rect\")\n"
362 "Meta Shift<KeyPress>osfUp: process_shift_up(\"rect\")\n"
363 "Shift Ctrl<KeyPress>osfUp: backward_paragraph(\"extend\")\n"
364 "Ctrl<KeyPress>osfUp: backward_paragraph()\n"
365 "Shift<KeyPress>osfUp: process_shift_up()\n"
366 "~Alt~Shift~Ctrl~Meta<KeyPress>osfUp: process_up()\n"
367
368
369 #ifndef DISABLE_MULTICURSOR
370 "Ctrl Super<KeyPress>osfDown: add_cursor_down()\n"
371 #endif
372 "Alt Shift Ctrl<KeyPress>osfDown: forward_paragraph(\"extend\", \"rect\")\n"
373 "Meta Shift Ctrl<KeyPress>osfDown: forward_paragraph(\"extend\", \"rect\")\n"
374 "Alt Shift<KeyPress>osfDown: process_shift_down(\"rect\")\n"
375 "Meta Shift<KeyPress>osfDown: process_shift_down(\"rect\")\n"
376 "Shift Ctrl<KeyPress>osfDown: forward_paragraph(\"extend\")\n"
377 "Ctrl<KeyPress>osfDown: forward_paragraph()\n"
378 "Shift<KeyPress>osfDown: process_shift_down()\n"
379 "~Alt~Shift~Ctrl~Meta<KeyPress>osfDown: process_down()\n"
380
381
382 "Alt Shift Ctrl<KeyPress>osfPageUp: page_left(\"extend\", \"rect\")\n"
383 "Meta Shift Ctrl<KeyPress>osfPageUp: page_left(\"extend\", \"rect\")\n"
384 "Alt Shift<KeyPress>osfPageUp: previous_page(\"extend\", \"rect\")\n"
385 "Meta Shift<KeyPress>osfPageUp: previous_page(\"extend\", \"rect\")\n"
386 "Shift Ctrl<KeyPress>osfPageUp: page_left(\"extend\")\n"
387 "Ctrl<KeyPress>osfPageUp: previous_document()\n"
388 "Shift<KeyPress>osfPageUp: previous_page(\"extend\")\n"
389 "~Alt ~Shift ~Ctrl ~Meta<KeyPress>osfPageUp: previous_page()\n"
390
391
392 "Alt Shift Ctrl<KeyPress>osfPageDown: page_right(\"extend\", \"rect\")\n"
393 "Meta Shift Ctrl<KeyPress>osfPageDown: page_right(\"extend\", \"rect\")\n"
394 "Alt Shift<KeyPress>osfPageDown: next_page(\"extend\", \"rect\")\n"
395 "Meta Shift<KeyPress>osfPageDown: next_page(\"extend\", \"rect\")\n"
396 "Shift Ctrl<KeyPress>osfPageDown: page_right(\"extend\")\n"
397 "Ctrl<KeyPress>osfPageDown: next_document()\n"
398 "Shift<KeyPress>osfPageDown: next_page(\"extend\")\n"
399 "~Alt ~Shift ~Ctrl ~Meta<KeyPress>osfPageDown: next_page()\n"
400
401
402
403
404
405
406
407 "Alt Shift<KeyPress>osfPageLeft: page_left(\"extend\", \"rect\")\n"
408 "Meta Shift<KeyPress>osfPageLeft: page_left(\"extend\", \"rect\")\n"
409 "Shift<KeyPress>osfPageLeft: page_left(\"extend\")\n"
410 "~Alt ~Shift ~Ctrl ~Meta<KeyPress>osfPageLeft: page_left()\n"
411
412
413 "Alt Shift<KeyPress>osfPageRight: page_right(\"extend\", \"rect\")\n"
414 "Meta Shift<KeyPress>osfPageRight: page_right(\"extend\", \"rect\")\n"
415 "Shift<KeyPress>osfPageRight: page_right(\"extend\")\n"
416 "~Alt ~Shift ~Ctrl ~Meta<KeyPress>osfPageRight: page_right()\n"
417
418
419 "Ctrl <Key>+: zoom_in()\n"
420 "Ctrl <Key>-: zoom_out()\n"
421 "Ctrl <Key>KP_Add: zoom_in()\n"
422 "Ctrl <Key>KP_Subtract: zoom_out()\n"
423
424 "Shift<KeyPress>osfSelect: key_select()\n"
425 "<KeyPress>osfCancel: process_cancel()\n"
426 "Ctrl~Alt~Meta<KeyPress>v: paste_clipboard()\n"
427 "Ctrl~Alt~Meta<KeyPress>c: copy_clipboard()\n"
428 "Ctrl~Alt~Meta<KeyPress>x: cut_clipboard()\n"
429 "Ctrl~Alt~Meta<KeyPress>u: delete_to_start_of_line()\n"
430 "Ctrl<KeyPress>Return: newline_and_indent()\n"
431 "Shift<KeyPress>Return: newline_no_indent()\n"
432 "<KeyPress>Return: newline()\n"
433
434
435 "Shift<KeyPress>osfActivate: newline_no_indent()\n"
436 "<KeyPress>osfActivate: newline()\n"
437 "Ctrl<KeyPress>Tab: self_insert()\n"
438 "<KeyPress>Tab: process_tab()\n"
439 "Alt Shift Ctrl<KeyPress>space: key_select(\"rect\")\n"
440 "Meta Shift Ctrl<KeyPress>space: key_select(\"rect\")\n"
441 "Shift Ctrl~Meta~Alt<KeyPress>space: key_select()\n"
442 "Ctrl~Meta~Alt<KeyPress>slash: select_all()\n"
443 "Ctrl~Meta~Alt<KeyPress>backslash: deselect_all()\n"
444 "<KeyPress>: self_insert()\n"
445 "Alt Ctrl<Btn1Down>: move_destination()\n"
446 "Meta Ctrl<Btn1Down>: move_destination()\n"
447 "Shift Ctrl<Btn1Down>: extend_start(\"rect\")\n"
448 "Shift<Btn1Down>: extend_start()\n"
449 #ifndef DISABLE_MULTICURSOR
450 "Ctrl<Btn1Down>: grab_focus(\"mc\")\n"
451 #endif
452 "<Btn1Down>: grab_focus()\n"
453 "Button1 Ctrl<MotionNotify>: extend_adjust(\"rect\")\n"
454 "Button1~Ctrl<MotionNotify>: extend_adjust()\n"
455 "<Btn1Up>: extend_end()\n"
456 "<Btn2Down>: secondary_or_drag_start()\n"
457 "Shift Ctrl Button2<MotionNotify>: secondary_or_drag_adjust(\"rect\", \"copy\", \"overlay\")\n"
458 "Shift Button2<MotionNotify>: secondary_or_drag_adjust(\"copy\")\n"
459 "Ctrl Button2<MotionNotify>: secondary_or_drag_adjust(\"rect\", \"overlay\")\n"
460 "Button2<MotionNotify>: secondary_or_drag_adjust()\n"
461 "Shift Ctrl<Btn2Up>: move_to_or_end_drag(\"copy\", \"overlay\")\n"
462 "Shift <Btn2Up>: move_to_or_end_drag(\"copy\")\n"
463 "Alt<Btn2Up>: exchange()\n"
464 "Meta<Btn2Up>: exchange()\n"
465 "Ctrl<Btn2Up>: copy_to_or_end_drag(\"overlay\")\n"
466 "<Btn2Up>: copy_to_or_end_drag()\n"
467 "Ctrl~Meta~Alt<Btn3Down>: mouse_pan()\n"
468 "Ctrl~Meta~Alt Button3<MotionNotify>: mouse_pan()\n"
469 "<Btn3Up>: end_drag()\n"
470 "<FocusIn>: focusIn()\n"
471 "<FocusOut>: focusOut()\n"
472
473 "Shift<Btn4Down>,<Btn4Up>: scroll_up(1)\n"
474 "Shift<Btn5Down>,<Btn5Up>: scroll_down(1)\n"
475 "Ctrl<Btn4Down>,<Btn4Up>: scroll_up(1, pages)\n"
476 "Ctrl<Btn5Down>,<Btn5Up>: scroll_down(1, pages)\n"
477 "<Btn4Down>,<Btn4Up>,<MotionNotify>(1+): extend_adjust()\n"
478 "<Btn5Down>,<Btn5Up>,<MotionNotify>(1+): extend_adjust()\n"
479 "<Btn4Down>,<Btn4Up>: scroll_up(5)\n"
480 "<Btn5Down>,<Btn5Up>: scroll_down(5)\n";
481
482 483