Kivy触摸工具

KiTT的Python项目详细描述


这个工具是一个小的xorg服务,它提供了一种定义 xorg用户界面控件的多点触控手势。它是基于基维的手势 检测并可以运行多种插件来控制用户界面。你可以 使用json配置文件轻松配置手势。

Kitt利用了 Kivy触摸和手势检测框架小组。 你的老鼠必须被基维发现才能和基特一起工作,而且 因此,将作为已知的{TT1}$设备存在。

以及 here 我写了一篇关于它的博文!

安装

要安装应用程序,只需从pipy获得它:

pip install kitt

要在xorg启动时运行它,不要忘记在 .xinitrc.xsession文件!

配置

看看kivy特有的configuration options

  • 操作配置文件:config_actions.json

要添加新的手势和绑定动作,您应该创建一个配置 文件,或者在默认路径:~/.kivy/kitt.json中,或者在 可以使用命令行选项指定。

要进行配置,文件应符合以下格式,请小心, 每个逗号、引号或括号都很重要:

{
    "engines": [],
    "actions": {
        "pinch_in"          : [],
        "pinch_out"         : [],
        "two_swipe_up"      : [],
        "two_swipe_down"    : [],
        "two_swipe_left"    : [],
        "two_swipe_right"   : [],
        "three_swipe_up"    : [],
        "three_swipe_down"  : [],
        "three_swipe_left"  : [],
        "three_swipe_right" : [],
        "four_swipe_up"     : [],
        "four_swipe_down"   : [],
        "four_swipe_left"   : [],
        "four_swipe_right"  : []
    }
}

* The `engines` key can contain three plugins: `xlib`, `wnck` and `dbus`.
* The `action` key contains for each known common multitouch gesture the action to trigger,
that depends on the engine you use.
  • 手势配置文件:config_gestures.json

    {
        "move_down" : [],
        "move_up"   : [],
        "move_left" : [],
        "move_right": []
    }
    
    • gestures键包含触摸的特定手势 装置。要记录它们,您必须按如下方式执行kitt,并且 复制它为每个 要录制的手势。

      基特前景-V

以下是可用的不同操作:

  • xlib引擎:{“函数”:“工作区”,“参数”:{ “方向”:“n”}}

切换当前工作空间,n是要跳过的工作空间数 (可以是正数或负数)

{
  "function": "keypress",
  "parameters": {
    "target": ["app1", "app2"],
    "keys": ["KEY1", "KEY2"]
  }
}

执行按键笔划,可以是多个按键的组合 (修改键,或从下面列表中输入键)“目标” 属性是窗口的wm-class属性之一。可能是 在对未知窗口触发操作时找到 foreground模式。

{ "function": "mouseclick",
  "parameters": {
    "button": "ButtonN"
  }
}

执行单击(可以是Button1Button2Button3button4Button5

  • wnck引擎:

    {“函数”:“工作区向上”,参数:{}}

切换到上一个工作区

{ "function": "workspace_down", parameters: {} }

切换到下一个工作区

  • dbus引擎:

    {“函数”:“发送数据库”,“参数”:{“服务”: “name.of.the.service”,“path”:“/path/to/the/object”,“method”: “methodname”“parameters”:[“param1”,“param2”…]}}

对服务service,对象路径object调用方法 所需参数

开发

为了开发,您需要zc.buildout (apt-get install python-zc.buildoutpip install zc.buildout

% git clone https://github.com/guyzmo/kitt.git
% cd kitt
% buildout

延长

要添加新的手势或新的交互方式,您可以复制并建立 处理$SRC/kitt/plugin_wnck.pyplugin_xlib.py。引擎 plugin_dbus.py有一个基本的dbus交互函数。

请分出项目,并给我回补丁!

待办事项

  • 实现夹入/夹出功能和其他奇怪的手势;
  • 创建一个类似btt的gui

许可证

整个软件是在gplv3下发布的。

键列表

0                  F33                L2                 Touroku            idiaeresis
1                  F34                L3                 U                  igrave
2                  F35                L4                 Uacute             j
3                  F4                 L5                 Ucircumflex        k
4                  F5                 L6                 Udiaeresis         l
5                  F6                 L7                 Ugrave             less
6                  F7                 L8                 Undo               m
7                  F8                 L9                 Up                 macron
8                  F9                 Left               V                  masculine
9                  Find               Linefeed           W                  minus
A                  G                  M                  X                  mu
AE                 H                  Mae_Koho           Y                  multiply
Aacute             Hankaku            Massyo             Yacute             n
Acircumflex        Help               Menu               Z                  nobreakspace
Adiaeresis         Henkan             Meta_L             Zen_Koho           notsign
Agrave             Henkan_Mode        Meta_R             Zenkaku            ntilde
Alt_L              Hiragana           Mode_switch        Zenkaku_Hankaku    numbersign
Alt_R              Hiragana_Katakana  Muhenkan           a                  o
Aring              Home               Multi_key          aacute             oacute
Atilde             Hyper_L            MultipleCandidate  acircumflex        ocircumflex
B                  Hyper_R            N                  acute              odiaeresis
BackSpace          I                  Next               adiaeresis         ograve
Begin              Iacute             Ntilde             ae                 onehalf
Break              Icircumflex        Num_Lock           agrave             onequarter
C                  Idiaeresis         O                  ampersand          onesuperior
Cancel             Igrave             Oacute             apostrophe         ordfeminine
Caps_Lock          Insert             Ocircumflex        aring              oslash
Ccedilla           J                  Odiaeresis         asciicircum        otilde
Clear              K                  Ograve             asciitilde         p
Control_L          KP_0               Ooblique           asterisk           paragraph
Control_R          KP_1               Otilde             at                 parenleft
D                  KP_2               P                  atilde             parenright
Delete             KP_3               Page_Down          b                  percent
Down               KP_4               Page_Up            backslash          period
E                  KP_5               Pause              bar                periodcentered
ETH                KP_6               PreviousCandidate  braceleft          plus
Eacute             KP_7               Print              braceright         plusminus
Ecircumflex        KP_8               Prior              bracketleft        q
Ediaeresis         KP_9               Q                  bracketright       question
Egrave             KP_Add             R                  brokenbar          questiondown
Eisu_Shift         KP_Begin           R1                 c                  quotedbl
Eisu_toggle        KP_Decimal         R10                ccedilla           quoteleft
End                KP_Delete          R11                cedilla            quoteright
Escape             KP_Divide          R12                cent               r
Eth                KP_Down            R13                colon              registered
Execute            KP_End             R14                comma              s
F                  KP_Enter           R15                copyright          script_switch
F1                 KP_Equal           R2                 currency           section
F10                KP_F1              R3                 d                  semicolon
F11                KP_F2              R4                 degree             slash
F12                KP_F3              R5                 diaeresis          space
F13                KP_F4              R6                 division           ssharp
F14                KP_Home            R7                 dollar             sterling
F15                KP_Insert          R8                 e                  t
F16                KP_Left            R9                 eacute             thorn
F17                KP_Multiply        Redo               ecircumflex        threequarters
F18                KP_Next            Return             ediaeresis         threesuperior
F19                KP_Page_Down       Right              egrave             twosuperior
F2                 KP_Page_Up         Romaji             equal              u
F20                KP_Prior           S                  eth                uacute
F21                KP_Right           Scroll_Lock        exclam             ucircumflex
F22                KP_Separator       Select             exclamdown         udiaeresis
F23                KP_Space           Shift_L            f                  ugrave
F24                KP_Subtract        Shift_Lock         g                  underscore
F25                KP_Tab             Shift_R            grave              v
F26                KP_Up              SingleCandidate    greater            w
F27                Kana_Lock          Super_L            guillemotleft      x
F28                Kana_Shift         Super_R            guillemotright     y
F29                Kanji              Sys_Req            h                  yacute
F3                 Katakana           T                  hyphen             ydiaeresis
F30                L                  THORN              i                  yen
F31                L1                 Tab                iacute             z
F32                L10                Thorn              icircumflex

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
带有嵌套JAR的java RCP ClassNotFoundException   java在输入框中设置默认值,crud应用程序使用spring   java如何在Heroku中使用fs创建新文件   java将JPanel放在JFrame中   java这个正则表达式会匹配“i.imgur.com/xxx”吗?   java在片段内创建RecylerView,而无需在Android中设置片段   Android上Groovy导致java错误的双精度浮点精度损失   swing Java查找JFrame属于JPanel的内容   java Spring junit自连线自定义类本身必须有构造函数吗?   java textswitcher支持前面的文本   从Android客户端到JAXRS的java Post自定义对象   java如何检索JSON数据并使用MPAndroidChart绘制折线图,以及在安卓上的改进   拒绝用户“root”@“localhost”的java c3p0访问(使用密码“是”)   使用Selenium Webdriver自动化ExtJS应用程序时java面临的问题