Mouse Gestures Recognition in Emacs

22 Nov

I just realized that Emacs has mouse gesture recognition and it is called strokes-mode. I enabled it simply by M-x strokes-mode and then by invoking M-x strokes-global-set-stroke I created a very simple mouse gesture (by pressing left mouse button and dragging leftwards it along a more or less straight line) and then after pressing the right mouse button (that is the rightmost mouse button with scroll moused, mouse 3 in Emacs terminology) assigned the kill-buffer function to the mouse gesture. After that I pressed Shift and then dragged the mouse while pressing the middle button and saw that it correctly interpreted the gesture by invoking kill-buffer function.

Mouse gestures in Emacs

Mouse gestures in Emacs

Immediate help about gesture recognition is available via M-x strokes-help. You can learn more about the internals of gesture recognition in Emacs simply by reading the source code at

Not that I’d prefer using mouse gestures for simple commands but nevertheless I was surprised to discover yet another feature of Emacs which helps its fame of being called “… has everything but the kitchen sink”😉

1 Comment

Posted by on November 22, 2010 in Emacs, Programlama


One response to “Mouse Gestures Recognition in Emacs

  1. Ruben Berenguel

    December 7, 2010 at 21:57

    Indeed, strokes-mode is very powerful. I had been using it for a while, but when I got my Mac, I gave up: I was no longer using a mouse (the trackpad of a Mac is so good you tend to prefer it over a mouse, unless the task requires very high precision). I used it to start EMMS (the Emacs Multimedia System), that I used before I got an iPod and switched to… iTunes. Although I love EMMS:-/ Have you tried it?


    In my blog: The Emacs 30 Day Challenge: Use just emacs for (almost) everything for 30 days


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: