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