在emacs lisp中使用侧滑动手势

时间:2012-04-05 02:50:36

标签: emacs elisp

我想在emacs中使用双指侧滑动手势。对于向上和向下滑动,它们绑定到[mouse-4][mouse-5]。是否有另一个绑定两个手指侧滑?如果没有,是否有任何事件触发two finger mouse运动?感谢。

3 个答案:

答案 0 :(得分:2)

我希望这是可能的,但我不认为Emacs默认会对触摸板有所了解。向上和向下滑动时看到的事件是鼠标滚轮上/下事件:

`(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

答案 1 :(得分:2)

听起来你或多或少都会问mouse gestures。如果是这样,那么答案是肯定的。 Emacs具有鼠标手势支持:库strokes.el和次模式strokes-mode就是这样。这是doc字符串:

Toggle Strokes模式,一种全局次模式。 使用前缀参数ARG,如果是ARG,则启用Strokes模式 积极的,否则禁用它。如果从Lisp调用,则启用 省略ARG或nil的模式。

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 :(得分:0)

这是我在OSX 10.6.8上上下滚动的方式。

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