emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard Access For gdb-ui.el (from emacs 21.3.50 CVS)


From: Kevin Rodgers
Subject: Re: Keyboard Access For gdb-ui.el (from emacs 21.3.50 CVS)
Date: Wed, 06 Aug 2003 14:28:05 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Nick Roberts forwarded this from T. V. Raman:

Incidentally given that mouse events are nothing more than list
structures, would it be possible to create a
keyboard-generate-mouse-event function?

Would be a nice means to exploit some of the newer features of emacs
---as an example, balloon help in itself may not be directly useful to the emacspeak user --- you really dont want emacs
intrrupting what you're listening to and tell you things --makes it
too much like the dreaded office-clip from idiot-proven interfaces. On
the other hand it would be nice to ask for a tooltip.

So I might move through a source file --- and push a key to hear the
value of an identifier spoken to me.

Do you use the mouse to move through the source file?  If so, you could
bind this hacked up `tooltip-keyboard' command to a keyboard event in the
global keymap:


(defun tooltip-keyboard ()
  "Command handler for keyboard events in `global-map'."
  (interactive)
  ;; See tooltip-mouse-motion:
  (tooltip-hide)
  (let ((event `(mouse-movement
                 (,(selected-window) ,(point) (nil . nil) ,(tooltip-time)))))
    (setq tooltip-last-mouse-motion-event event)
    (tooltip-start-delayed-tip)))

(defsubst tooltip-time ()
  "The current time in milliseconds, for use as a mouse event TIMESTAMP."
  ;; This should be done as an integer calculation that wraps around:
  (let ((time (current-time)))
    (+ (* 1000
          ;; seconds since the Epoch:
          (+ (* 1.0 (expt 2 16) (car time))
             (cadr time)))
       (/ 1000.0
          ;; additional microseconds:
          (car (cddr time))))))

If you don't use the mouse at all, it gets tricky because we have to generate
pixel coordinates for the fake mouse event from point in the selected window,
which I can't figure out how to do...

--
Kevin Rodgers






reply via email to

[Prev in Thread] Current Thread [Next in Thread]