Apple Magic Mouse 多点触控在 Linux 里的安装与配置

Felix 弄来一只 Apple Magic Mouse 小白, 蓝牙配对上后发现各种scrolling很靠谱, 三键也支持好了, 但是多指动作没有支持…
在各种Google之后, 找到了有人使用 PyMT 来实现 Magic Mouse 多点触控手势的脚本, 由于原脚本(参考资料1)是针对GNOME/compiz的, 而且网上没有靠谱的KDE可用版本, 于是本猫自己Hack了一下…

安装说明:
首先要安装pymt, ArchLinux用户可以直接

Ubuntu用户可以直接

接下来, 配置pymt识别MagicMouse的多点触控:
编辑 ~/.pymt/config
找到 [input] 段, 修改为:

上面的<n>需要替换成MagicMouse对应的编号, 可以用下面这个本猫写的挫挫的语句察看:

然后, 给这个文件(设备?信号?事件? = =不知道怎么称呼了)加上读属性, 以使得pymt可以用当前用户身份读取:

至此, 可以认为pymt安装好啦!
测试:

(arch用户自行改为python2 = =)

接下来…可以试试我的脚本啦!

— Changelog:
2011/4/19 – 第二个版本, 增加了三指上下调节系统音量的功能~~
2011/4/19 – 第一个版本, 仅简单实现了双指Swipe Left/Right 切换虚拟桌面的效果.

很简单哟~快来自定义属于自己的快捷键吧^_^

参考资料:
1, https://gist.github.com/546779
2, http://ubuntuforums.org/archive/index.php/t-1386790.html
3, http://pymt.eu/wiki/DevGuide/InstallPymtUbuntu
4, http://pymt.eu/wiki/DevGuide/InputConfiguration
5, http://pymt.eu/wiki/DevGuide/ConfigurationFile

14 thoughts on “Apple Magic Mouse 多点触控在 Linux 里的安装与配置”

  1. python -m pymt.tools.demo
    [INFO ] PyMT v0.5.1
    [WARNING] [Core ] Accelerate module not available
    [INFO ] [Logger ] Record log in /home/qianlnk/.pymt/logs/pymt_16-09-22_10.txt
    [WARNING] [Core ] Execute “python setup.py build_ext–inplace”
    [INFO ] [No OpenGL_accelerate module loaded] No module named OpenGL_accelerate
    [INFO ] [Unable to load registered array format handler numeric]
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/formathandler.py”, line 35, in loadPlugin
    plugin_class = entrypoint.load()
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 14, in load
    return importByName( self.import_path )
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 28, in importByName
    module = __import__( “.”.join(moduleName), {}, {}, moduleName)
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/numeric.py”, line 15, in
    raise ImportError( “””No Numeric module present: %s”””%(err))
    ImportError: No Numeric module present: No module named Numeric

    [INFO ] [Unable to load registered array format handler vbo]
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/formathandler.py”, line 35, in loadPlugin
    plugin_class = entrypoint.load()
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 14, in load
    return importByName( self.import_path )
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 28, in importByName
    module = __import__( “.”.join(moduleName), {}, {}, moduleName)
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/vbo.py”, line 33, in
    from OpenGL import GL
    ImportError: cannot import name GL

    [INFO ] [Unable to load registered array format handler vbooffset]
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/formathandler.py”, line 35, in loadPlugin
    plugin_class = entrypoint.load()
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 14, in load
    return importByName( self.import_path )
    File “/usr/lib/python2.7/dist-packages/OpenGL/plugins.py”, line 28, in importByName
    module = __import__( “.”.join(moduleName), {}, {}, moduleName)
    File “/usr/lib/python2.7/dist-packages/OpenGL/arrays/vbo.py”, line 33, in
    from OpenGL import GL
    ImportError: cannot import name GL

    /usr/bin/python: cannot import name GL_TEXTURE_RECTANGLE_NV

  2. fy,有空上一下QQ。想开发一个只统计群邮发言次数和发布资源次数的软件,不统计附件大小。不知是否可行,5.1期间有空没?Deep Blue留~

          1. 我显然没有你重~
            最上面那位同学,我有好多多余的无线鼠哦~~

            这个嵌套可以套多深? 会不会超出页面宽度? 胖猫继续

Leave a Reply

Your email address will not be published.