annotate lisp/hyperbole/hmouse-sh.el @ 0:376386a54a3c r19-14

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