Using swipe side gestures in emacs lisp

I want to use two finger swipe gestures in emacs. To scroll up and down, they are anchored to [mouse-4]

and [mouse-5]

. Is there another bind for two fingers? If not, are there any events that fire when moving two finger mouse

? Thank.

+3


source to share


3 answers


I expect this to be possible, but I don't think Emacs knows anything about default touchpads. The events you see when scrolling up and down are up / down mouse events:

`(wheel-up POSITION)'

`(wheel-down POSITION)'
     These kinds of event are generated by moving a mouse wheel.  Their
     usual meaning is a kind of scroll or zoom.

     The element POSITION is a list describing the position of the
     event, in the same format as used in a mouse-click event (*note
     Click Events::).

     This kind of event is generated only on some kinds of systems. On
     some systems, `mouse-4' and `mouse-5' are used instead.  For
     portable code, use the variables `mouse-wheel-up-event' and
     `mouse-wheel-down-event' defined in `mwheel.el' to determine what
     event types to expect for the mouse wheel.

      



M-: (info "(elisp) Misc Events")

RET

+2


source


Sounds like you are asking about mouse gestures

, more or less. If yes, then the answer is yes. Emacs supports mouse support: the library strokes.el

and minor mods strokes-mode

are designed to do just that. Here is the doc line:

Toggle strokes mode, global minor mode. With the ARG prefix argument, enable Strokes mode if ARG is positive and disable it otherwise. If called from Lisp, enable mode if ARG is omitted or absent.



Strokes are pictographic mouse gestures which invoke commands.
Strokes are invoked with S-down-mouse-2.  You can define
new strokes with M-x strokes-global-set-stroke.  See also
M-down-mouse-2 for `complex' strokes.

To use strokes for pictographic editing, such as Chinese/Japanese, use
M-x strokes-compose-complex-stroke, which draws strokes and inserts them.
Encode/decode your strokes with M-x strokes-encode-buffer,
M-x strokes-decode-buffer.

key             binding
---             -------

<M-down-mouse-2>                strokes-do-complex-stroke
<S-down-mouse-2>                strokes-do-stroke

      

+2


source


This is how I scroll up and down in OSX 10.6.8.

(global-set-key [(wheel)] 'mwheel-scroll) ;; magic mouse track-pad

      

0


source







All Articles