annotate lisp/hyperbole/hmouse-sh.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 376386a54a3c
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: hmouse-sh.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: System-dependent Smart Mouse Key bindings (using shift key).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: hypermedia, mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
9 ;; ORG: InfoDock Associates
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 3-Sep-91 at 21:40:58
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
12 ;; LAST-MOD: 21-Feb-97 at 18:02:48 by Bob Weiner
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
17 ;; Copyright (C) 1991-1997, Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; See description in "hmouse-key.el".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (defun hmouse-get-bindings ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 "Returns list of bindings for mouse keys prior to their use as Smart Keys."
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
32 ;; Do nothing when running in batch mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
33 (if noninteractive
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
34 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
35 (eval
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
36 (cdr (assoc
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
37 ;; Get mouse bindings under Emacs 19 or XEmacs, even if not under a
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
38 ;; window system since it can have frames on ttys and windowed
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
39 ;; displays at the same time.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
40 (or (and hyperb:xemacs-p "lemacs")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
41 (and hyperb:emacs19-p "emacs19")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
42 hyperb:window-system)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
43 '(("emacs19" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
44 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
45 (lambda (key) (cons key (lookup-key global-map key))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
46 (if (memq window-system '(ns dps))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
47 ;; NEXTSTEP offers only 2 shift-mouse buttons which we use
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
48 ;; as the Smart Keys.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
49 '([S-down-mouse-1] [S-mouse-1] [S-down-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
50 [S-mouse-2] [S-double-mouse-1] [S-triple-mouse-1]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
51 [S-double-mouse-2] [S-triple-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
52 [vertical-line S-down-mouse-1]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
53 [vertical-line S-mouse-1]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
54 [vertical-line S-down-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
55 [vertical-line S-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
56 [mode-line S-down-mouse-1] [mode-line S-mouse-1]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
57 [mode-line S-down-mouse-2] [mode-line S-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
58 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
59 ;; X
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
60 '([S-down-mouse-2] [S-mouse-2] [S-down-mouse-3]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
61 [S-mouse-3] [S-double-mouse-2] [S-triple-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
62 [S-double-mouse-3] [S-triple-mouse-3]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 [vertical-line S-down-mouse-2]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 [vertical-line S-mouse-2]
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
65 [vertical-line S-down-mouse-3]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
66 [vertical-line S-mouse-3]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 [mode-line S-down-mouse-2] [mode-line S-mouse-2]
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
68 [mode-line S-down-mouse-3] [mode-line S-mouse-3]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
69 ))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
70 ("lemacs" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
71 (nconc
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
72 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
73 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
74 (cons key (lookup-key global-map key))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
75 '([(shift button2)] [(shift button2up)]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
76 [(shift button3)] [(shift button3up)]))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
77 (if (boundp 'mode-line-map)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
78 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
79 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
80 (cons key (lookup-key mode-line-map key))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
81 '([(shift button3)] [(shift button3up)])))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
82 ("xterm" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
83 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
84 (lambda (key) (cons key (lookup-key mouse-map key))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
85 (list x-button-s-middle x-button-s-middle-up
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
86 x-button-s-right x-button-s-right-up)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
87 ("epoch" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
88 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
89 (lambda (key) (cons key (aref mouse::global-map key))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
90 (list (mouse::index mouse-middle mouse-shift)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
91 (mouse::index mouse-middle mouse-shift-up)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
92 (mouse::index mouse-right mouse-shift)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
93 (mouse::index mouse-right mouse-shift-up)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
94 ;; Modeline mouse map
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
95 (mouse::index mouse-mode-middle mouse-shift)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
96 (mouse::index mouse-mode-middle mouse-shift-up)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
97 (mouse::index mouse-mode-right mouse-shift)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
98 (mouse::index mouse-mode-right mouse-shift-up)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
99 )))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
100 ("next" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
101 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
102 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
103 (cons key (mousemap-get
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
104 (mouse-list-to-mouse-code key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
105 current-global-mousemap))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
106 (apply 'nconc
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
107 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
108 (lambda (region)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
109 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
110 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
111 (cons region key)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
112 '((shift left) (shift up left)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
113 (shift right)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
114 (shift up right)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
115 ))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
116 '(text scrollbar modeline minibuffer)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
117 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
118 ;; SunView
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
119 ("sun" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
120 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
121 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
122 (setq key (mouse-list-to-mouse-code key))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
123 (cons key (mousemap-get
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
124 key current-global-mousemap))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
125 (apply 'nconc
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
126 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
127 (lambda (region)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
128 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
129 (lambda (key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
130 (cons region key)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
131 '((shift middle)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
132 (shift up middle)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
133 (shift right)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
134 (shift up right)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
135 ))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
136 '(text scrollbar modeline minibuffer)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
137 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
138 ("apollo" .
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
139 (mapcar (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
140 (lambda (key-str) (apollo-mouse-key-and-binding
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
141 key-str)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
142 '("M2S" "M2U" "M3S" "M3U")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
143 ))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (defun hmouse-setup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 "Binds mouse keys for use as Smart Keys."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (interactive)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
148 ;; Do nothing when running in batch mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
149 (if noninteractive
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
150 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
151 (or hmouse-bindings-flag hmouse-previous-bindings
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
152 (setq hmouse-previous-bindings (hmouse-get-bindings)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
153 ;; Ensure Gillespie's Info mouse support is off since
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
154 ;; Hyperbole handles that.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
155 (setq Info-mouse-support nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
156 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
157 (cond;; GNU Emacs 19
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
158 (hyperb:emacs19-p
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
159 (setq hmouse-set-point-command 'mouse-set-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
160 (if (memq window-system '(ns dps))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
161 ;; NEXTSTEP offers only 2 shift-mouse buttons which we use
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
162 ;; as the Smart Keys.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
163 (progn
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
164 (global-set-key [S-down-mouse-1] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
165 (global-set-key [S-mouse-1] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
166 (global-set-key [S-double-mouse-1] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
167 (global-set-key [S-triple-mouse-1] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
168 (global-set-key [S-down-mouse-2] 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
169 (global-set-key [S-mouse-2] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
170 (global-set-key [S-double-mouse-2] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
171 (global-set-key [S-triple-mouse-2] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
172 (global-set-key [vertical-line S-down-mouse-1] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
173 (global-set-key [vertical-line S-mouse-1] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
174 (global-set-key [vertical-line S-down-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
175 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
176 (global-set-key [vertical-line S-mouse-2]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
177 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
178 (global-set-key [mode-line S-down-mouse-1] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
179 (global-set-key [mode-line S-mouse-1] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
180 (global-set-key [mode-line S-down-mouse-2] 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
181 (global-set-key [mode-line S-mouse-2] 'assist-mouse-key-emacs19))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
182 ;; X
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
183 (global-set-key [S-down-mouse-2] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
184 (global-set-key [S-mouse-2] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
185 (global-set-key [S-double-mouse-2] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
186 (global-set-key [S-triple-mouse-2] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
187 (global-set-key [S-down-mouse-3] 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
188 (global-set-key [S-mouse-3] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
189 (global-set-key [S-double-mouse-3] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
190 (global-set-key [S-triple-mouse-3] 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
191 (global-set-key [vertical-line S-down-mouse-2] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
192 (global-set-key [vertical-line S-mouse-2] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
193 (global-set-key [vertical-line S-down-mouse-3]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
194 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
195 (global-set-key [vertical-line S-mouse-3]
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
196 'assist-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
197 (global-set-key [mode-line S-down-mouse-2] 'action-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
198 (global-set-key [mode-line S-mouse-2] 'action-mouse-key-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
199 (global-set-key [mode-line S-down-mouse-3] 'assist-key-depress-emacs19)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
200 (global-set-key [mode-line S-mouse-3] 'assist-mouse-key-emacs19)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
201 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
202 ;; XEmacs
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
203 (hyperb:xemacs-p
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
204 ;; Set mouse bindings under XEmacs, even if not under a window
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
205 ;; system since it can have frames on ttys and windowed displays at
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
206 ;; the same time.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
207 (setq hmouse-set-point-command 'hmouse-move-point-xemacs)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
208 (global-set-key '(shift button2) 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
209 (global-set-key '(shift button2up) 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
210 (if (fboundp 'infodock-set-mouse-bindings)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
211 (infodock-set-mouse-bindings)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
212 (if (boundp 'mode-line-map)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
213 (progn (define-key mode-line-map '(shift button3)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
214 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
215 (define-key mode-line-map '(shift button3up)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
216 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
217 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
218 (global-set-key '(shift button3) 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
219 (global-set-key '(shift button3up) 'assist-mouse-key)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
220 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
221 ;; X
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
222 ((equal hyperb:window-system "xterm")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
223 (setq hmouse-set-point-command 'x-mouse-set-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
224 (define-key mouse-map x-button-s-middle 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
225 (define-key mouse-map x-button-s-middle-up 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
226 (define-key mouse-map x-button-s-right 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
227 (define-key mouse-map x-button-s-right-up 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
228 ;; Use these instead of the above for a true META-BUTTON binding.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
229 ;; (define-key mouse-map x-button-m-middle 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
230 ;; (define-key mouse-map x-button-m-middle-up 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
231 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
232 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
233 ;; Epoch
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
234 ((equal hyperb:window-system "epoch")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
235 (setq hmouse-set-point-command 'mouse::set-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
236 (global-set-mouse mouse-middle mouse-shift 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
237 (global-set-mouse mouse-middle mouse-shift-up 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
238 (global-set-mouse mouse-right mouse-shift 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
239 (global-set-mouse mouse-right mouse-shift-up 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
240 ;; Modeline mouse map
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
241 (global-set-mouse mouse-mode-middle mouse-shift 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
242 (global-set-mouse mouse-mode-middle mouse-shift-up 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
243 (global-set-mouse mouse-mode-right mouse-shift 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
244 (global-set-mouse mouse-mode-right mouse-shift-up
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
245 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
246 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
247 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
248 ;; NeXT
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
249 ((equal hyperb:window-system "next")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
250 (setq hmouse-set-point-command 'hmouse-move-point-eterm)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
251 ;; Use left button to set point.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
252 ;; Use shift-left button instead of non-existent middle as Action Key.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
253 (mapcar
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
254 (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
255 (lambda (region)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
256 (global-set-mouse (cons region '(shift left)) 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
257 (global-set-mouse (cons region '(shift up left)) 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
258 (global-set-mouse (cons region '(shift right)) 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
259 (global-set-mouse (cons region '(shift up right))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
260 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
261 ;; Use these instead of the above for a true META-BUTTON binding.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
262 ;; (global-set-mouse (cons region '(meta right)) 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
263 ;; (global-set-mouse (cons region '(meta up right)) 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
264 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
265 '(text scrollbar modeline minibuffer))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
266 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
267 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
268 ;; SunView
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
269 ((equal hyperb:window-system "sun")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
270 (setq hmouse-set-point-command 'hmouse-move-point-eterm)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
271 (mapcar
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
272 (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
273 (lambda (region)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
274 (global-set-mouse (cons region '(shift middle)) 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
275 (global-set-mouse (cons region '(shift up middle))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
276 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
277 (global-set-mouse (cons region '(shift right)) 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
278 (global-set-mouse (cons region '(shift up right))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
279 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
280 ;; Use these instead of the above for a true META-BUTTON binding.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
281 ;; (global-set-mouse (cons region '(meta middle)) 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
282 ;; (global-set-mouse (cons region '(meta up middle)) 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
283 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
284 '(text scrollbar modeline minibuffer))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
285 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
286 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
287 ;; Apollo DM
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
288 ((equal hyperb:window-system "apollo")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
289 (setq hmouse-set-point-command 'apollo-mouse-move-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
290 (bind-apollo-mouse-button "M2S" 'action-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
291 (bind-apollo-mouse-button "M2U" 'action-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
292 (bind-apollo-mouse-button "M3S" 'assist-key-depress)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
293 (bind-apollo-mouse-button "M3U" 'assist-mouse-key)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
294 ))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
295 (setq hmouse-bindings (hmouse-get-bindings)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 0
diff changeset
296 hmouse-bindings-flag t)))