Keegan McAllister: taralli: Screen edge pointer wrapping for X

The maximum travel distance between points on a desktop is substantially reduced if the pointer is allowed to travel off a screen edge and reappear at the opposite edge. In other words, we change the topology of the desktop to be that of a torus. This is not a new idea: it’s implemented in several
window managers
, programs for
Windows
and
Mac OS X
, and is even the subject of a
research paper
.

I wanted a standalone program to implement mouse pointer wrapping for X Windows on GNU/Linux. Previously I was using
Synergy
for this task. Synergy is a very cool program, but it’s not a good choice for pointer wrapping on a single machine.

  • Correctness
    : I have several monitors at different resolutions, which means my desktop isn’t rectangular. Synergy didn’t understand where the edge of each monitor is.

  • Security
    : I don’t need the exposure of 95,000 lines of code for this simple task. Even if there are no bugs in Synergy, I’m one configuration mistake away from running an unencrypted network keylogger.

  • Energy efficiency
    : Synergy wakes up 40 times per second even when nothing is happening. This can have a significant impact on laptop battery life.

So I wrote

taralli

as a simple replacement. It doesn’t automatically understand non-rectangular desktops, but you can easily customize the pointer position mapping, to implement multi-monitor wrap-around or many other behaviors. (If someone would like to contribute the code to get multi-monitor information from
Xinerama
or something, I would be happy to add that.)

taralli
is under 100 lines of C99. It has been tested on GNU/Linux and is likely portable to other X platforms. You can
download it from GitHub
, which is also a great place to submit any bug reports or patches.

稿源:main is usually a function (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合技术 » Keegan McAllister: taralli: Screen edge pointer wrapping for X

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录