Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!dave From: dave@CS.WISC.EDU (Dave Cohrs) Newsgroups: gnu.emacs Subject: Re: emacs, X Windows & Sun 386i Message-ID: <8901192020.AA13381@romano.cs.wisc.edu> Date: 19 Jan 89 20:20:05 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 [ Harold Wilensky -- your return address, wilensky@dsg.ti.csc.com, doesn't work; check with your Postmaster for a valid address ] > 2. Can you detect double mouse clicks? Xterm seems to be able to do this but > I can't get emacs to see them. It's gross, but you can do it. Check out lisp/sun-mouse.el, which handles mouse events under suntools, for a basic idea of the technique. Under X11, you basically write a function to handle mouse *release* events, and in there you: (sit-for wait-time) (if (not (= (x-mouse-events) 0)) (setq mouse-count (1+ mouse-count)) (setq mouse-count 0)) and mouse-count will count how many mouse events occurred within your selected 'wait-time', one event at a time. In the corresponding mouse-press routine, you can do a (cond) depending on the value of mouse-count. I've used this technique to make a multiple click detector that lets me mark characters, words or lines. I'd send it along, but it's not fit for public distribution. If you have HAVE_SUN_WINDOWS defined, you can also use (sit-for-millisecs) instead of (sit-for). Here's an tangential question: Why is (sit-for-millisecs) part of the sun-windows support? It obviously has more general uses. I would think it belongs in some general area, along with (sit-for). On OS's that can't support it, it could just act like (sit-for). This is basically the same way xterm detects multiple clicks. > 3. Can you highlight a marked region? I don't think so. People are *often* asking about such support on this list, not just under the X window system, but in general. Maybe this would be a good thing to support? BTW -- You can't detect mouse motion events either, without changing the C code. Dave Cohrs