3

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

4

3 回答 3

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

于 2012-04-05T03:42:50.457 回答
2

听起来您mouse gestures或多或少地在问。如果是这样,那么答案是肯定的。Emacs 具有鼠标手势支持:库strokes.el和次要模式strokes-mode正是为此而设计的。这是文档字符串:

Toggle Strokes 模式,一种全局次要模式。使用前缀参数 ARG,如果 ARG 为正则启用 Strokes 模式,否则禁用它。如果从 Lisp 调用,如果 ARG 被省略或为零,则启用该模式。

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
于 2013-10-21T02:07:34.847 回答
0

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

(global-set-key [(wheel)] 'mwheel-scroll) ;; magic mouse track-pad
于 2013-10-21T02:14:34.057 回答