Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site emacs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!cca!emacs!pz From: pz@emacs.UUCP (Paul Czarnecki) Newsgroups: net.emacs Subject: Re: emacs mouse support Message-ID: <5@emacs.UUCP> Date: Thu, 16-Jan-86 08:10:48 EST Article-I.D.: emacs.5 Posted: Thu Jan 16 08:10:48 1986 Date-Received: Sat, 18-Jan-86 01:15:17 EST References: <912@mit-eddie.UUCP> Organization: Uniworks Inc., Wellesley, MA Lines: 146 Mouse Bindings First off, I am an employee of Uniworks Inc. At Uniworks I have written a mouse interface to Emacs. A lot of the design issues discussed in these articles (and probably future ones) are issues that I also had to handle. These issues are not specific to our product, they could apply to ANY ascii window manager with a mouse. See the disclaimer at the bottom. In <912@mit-eddie.UUCP> Ian Horswill writes: H> H> - What sorts of mouse events should be included in the protocol? H> e.g. do we allow chords of buttons, double clicks, etc. Since the Emacs user is picky (ok, sophisticated), I did not want to limit in any way the possible mouse events. Of course I had to in practice but I think I covered a lot of ground. Chords, multiples, multiple chords and null events (The mouse becoming still) are all permitted. The click interval is user settable. The maximum number of single button events is 4 clicks per button. These are the possible mouse events. L, M, R, LM, LR, MR, LMR, 2L, 2M, 2R, 2LM, 2LR, 2MR, 2LMR, 3L, 3M, 3R, 3LM, 3LR, 3MR, 3LMR, 4L, 4M, 4R, 4LM, 4LR, 4MR, 4LMR, 0 (still event) I have also divided the screen up into 4 areas: The Mode Line, the Echo Area, the Other Window, and the current Window. I call this the MEOW value. A mouse command will have a different action depending on where it was executed. For example, left clicking once in the Current Window will place the Emacs cursor where the mouse cursor is. However, this action is meaningless if done on the Mode line. Rather than just give an error I decided to do something useful. Left clicking once in the Mode line will go to the percentage down in the file that the mouse cursor is over in the mode line. If you are two thirds of the way from the left edge in the Mode line, a left click will take you two thirds of the way through the file. (This screen division is very similar to what I saw on the net a couple of months ago for the BBN Bitgraph, lost the attribution, sorry) This is almost like Macintosh sensitive areas (where click the little upper left box will close the window, dragging the bottom or right elevators will scroll the window). I have also divided the screen up into sensitive areas. Of course this is much cruder than the Mac because I hardly ever draw pretty little icons. Since using the mouse is expensive, (you have to remove your hands from the keyboard) commands placed on the mouse should be `worth it'. They should need positioning information or be part of a keystroke idiom that contains positioning information. For example, "Place the Emacs point at the mouse cursor" need positioning information. It is a natural candidate for mouse binding. On the other hand, "Place the killed region into the buffer at point" is not directly position dependent, but it is part of the whole cut/move/paste idiom. This also makes it a candidate for mouse binding. As I mentioned earlier, the mouse performs different actions based on where it is located on the screen. Here are the bindings that I use. Current Window Mode Line Echo Area Other Window L Set Point Goto % Shell in a Buffer L2 Set Mark Goto Begining Push to Shell L3 X Point & Mark Goto End Signal Shell L4 Point to Q-Reg Menu (NYI) M HIX Scroll Redisplay at Top Dired M2 HIX Grow Window Redis at Bottom Info M3 HIX Shrink Window Execute Minibuffer M4 Make R Kill Region Save File Tool Hide R2 Yank Region Save All Files Tool Close R3 Fill Region Append to File Tool Expose R4 Filter Region Unmodify Buffer Tool Open LMR Exit Exit Exit Still Current Window Null Null Note how all of the commands are grouped logically together. Since so much can be done with the mouse it must be easy to use/remember. The groupings are: placing moving Shell windows redisplay Sub systems regions Files Tool operations I also tried to organize the groups logically. Window actions take place in a window, Mode line actions (usually) relate to the items in the mode line, Echo area actions relate to "system" functions. Some don't fit (Menu and Make for example) Some of these were placed for other reasons (Exit and Current Window). Exit I wanted hard to type, hence the 3 button chord. And Current Window is the default operation (sort of) for changing Sun Windows. You just place the mouse cursor inside of the window that you want to be current. The only command set that might be confusing are the HIX commands. When a HIX command executes it determines the HIX value of the current position. HIX command will perform the action in the HIX direction. A HIX value can be one of UP, Down, Left, or Right. To determine the HIX value divide the window into four sectors by drawing an invisible 'H', 'I', or an 'X' over the screen. The directions (UDLR) map to a sector. For example, if the HIX character is set to 'I' (the default), then clicking middle once in the bottom third of the window will scroll that window down, middle clicking once in the top third of the window will scroll that window up. Clicking middle once in the left half (but not the top or bottom third will scroll that window left. It is important to remember that all of these bindings are not cast in stone. The user can rebind them on the fly or in an init file. pZ Disclaimer: I am an employee of Uniworks Inc. What I have said here could be considered to be of a commercial nature. I don't think that this is the case. I tried to stick to technical issues related to mouse support of a generic Emacs. The facts represented in this article are the current official statement of Uniworks regarding mouse support for CCA EMACS. These are subject to change without notice. The opinions expressed in this article are my own and are not necessarily shared by anybody else at Uniworks. Anybody is free is use the ideas expressed in this article. (I would be immensely flattered it this happened.) You cannot suppress ideas. The code, however, you will have to pay for. -- -- My wife ran off with my best friend, and I miss him. Paul Czarnecki Uniworks, Inc. decvax!{cca,wanginst!infinet}!emacs!pz 20 William Street emacs!pz@cca-unix.ARPA Wellesley, MA 02181 (617) 235-2600