comparison lisp/avoid.el @ 20858:efafba146bb5

(mouse-avoidance-fancy-hook): Do nothing if button is down. (mouse-avoidance-exile-hook, mouse-avoidance-banish-hook): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Fri, 06 Feb 1998 21:56:29 +0000
parents 65399b8cd0ad
children c87385403522
comparison
equal deleted inserted replaced
20857:185fa242a2ea 20858:efafba146bb5
265 (nth (random mouse-avoidance-n-pointer-shapes) 265 (nth (random mouse-avoidance-n-pointer-shapes)
266 mouse-avoidance-pointer-shapes)) 266 mouse-avoidance-pointer-shapes))
267 267
268 (defun mouse-avoidance-banish-hook () 268 (defun mouse-avoidance-banish-hook ()
269 (if (and (not executing-kbd-macro) ; don't check inside macro 269 (if (and (not executing-kbd-macro) ; don't check inside macro
270 ;; Don't check while mouse is down.
271 (not (and (consp last-input-event)
272 (symbolp (car last-input-event))
273 (memq 'down (event-modifiers (car last-input-event)))))
270 (mouse-avoidance-kbd-command (this-command-keys))) 274 (mouse-avoidance-kbd-command (this-command-keys)))
271 (mouse-avoidance-banish-mouse))) 275 (mouse-avoidance-banish-mouse)))
272 276
273 (defun mouse-avoidance-exile-hook () 277 (defun mouse-avoidance-exile-hook ()
274 ;; For exile mode, the state is nil when the mouse is in its normal 278 ;; For exile mode, the state is nil when the mouse is in its normal
275 ;; position, and set to the old mouse-position when the mouse is in exile. 279 ;; position, and set to the old mouse-position when the mouse is in exile.
276 (if (and (not executing-kbd-macro) 280 (if (and (not executing-kbd-macro)
281 (not (and (consp last-input-event)
282 (symbolp (car last-input-event))
283 (memq 'down (event-modifiers (car last-input-event)))))
277 (mouse-avoidance-kbd-command (this-command-keys))) 284 (mouse-avoidance-kbd-command (this-command-keys)))
278 (let ((mp (mouse-position))) 285 (let ((mp (mouse-position)))
279 (cond ((and (not mouse-avoidance-state) 286 (cond ((and (not mouse-avoidance-state)
280 (mouse-avoidance-too-close-p mp)) 287 (mouse-avoidance-too-close-p mp))
281 (setq mouse-avoidance-state mp) 288 (setq mouse-avoidance-state mp)
291 (setq mouse-avoidance-state nil)))))) 298 (setq mouse-avoidance-state nil))))))
292 299
293 (defun mouse-avoidance-fancy-hook () 300 (defun mouse-avoidance-fancy-hook ()
294 ;; Used for the "fancy" modes, ie jump et al. 301 ;; Used for the "fancy" modes, ie jump et al.
295 (if (and (not executing-kbd-macro) ; don't check inside macro 302 (if (and (not executing-kbd-macro) ; don't check inside macro
303 (not (and (consp last-input-event)
304 (symbolp (car last-input-event))
305 (memq 'down (event-modifiers (car last-input-event)))))
296 (mouse-avoidance-kbd-command (this-command-keys)) 306 (mouse-avoidance-kbd-command (this-command-keys))
297 (mouse-avoidance-too-close-p (mouse-position))) 307 (mouse-avoidance-too-close-p (mouse-position)))
298 (let ((old-pos (mouse-position))) 308 (let ((old-pos (mouse-position)))
299 (mouse-avoidance-nudge-mouse) 309 (mouse-avoidance-nudge-mouse)
300 (if (not (eq (selected-frame) (car old-pos))) 310 (if (not (eq (selected-frame) (car old-pos)))