emacs能否移动鼠标指针的位置?

多谢大佬紫薯布丁

1 个赞

请问具体格式怎么写,函数说明是

(set-mouse-posistion frame X Y) 

但是下面这样写直接报错

(set-mouse-posistion nil 0 0) 

另外请教如何实现默认把指针移到屏幕右下角,屏幕尺寸不一样,不能写死座标

最后是用hammerspoon实现的, 没用emacs的函数.

现在已经不用多屏了, 感觉多屏效率并不是很高, 至少对我来说效率不高. 不如单屏加workspace.

已经解决了

(set-mouse-posistion (selected-frame)  0 0)

我在windows下面只使用emacs,鼠标指针是相当挡视线

你是需要这个吧?mouse-avoidance-mode

1 个赞

我的需求比较奇葩,在emacs里面不想看到鼠标出现,所以用set-mouse-posistion设置了一个很大的偏移

我不确定mouse-avoidance-mode有没有这个效果

Documentation

Set Mouse Avoidance mode to MODE.

MODE should be one of the symbols banish, exile, jump, animate, cat-and-mouse, proteus, or none.

If MODE is nil, toggle mouse avoidance between none and banish modes. Positive numbers and symbols other than the above are treated as equivalent to banish; negative numbers and - are equivalent to none.

Effects of the different modes:

  • banish: Move the mouse to the upper-right corner on any keypress.
  • exile: Move the mouse to the corner only if the cursor gets too close, and allow it to return once the cursor is out of the way.
  • jump: If the cursor gets too close to the mouse, displace the mouse a random distance & direction.
  • animate: As jump, but shows steps along the way for illusion of motion.
  • cat-and-mouse: Same as animate.
  • proteus: As animate, but changes the shape of the mouse pointer too.

(See mouse-avoidance-threshold for definition of “too close”, and mouse-avoidance-nudge-dist and mouse-avoidance-nudge-var for definition of “random distance”.)

3 个赞