Kinemic Gesture2Keys

This tool can generate predefined keypresses on a client when a certain gesture is received from a Kinemic Publisher instance.

Configuration file

All configuration is done through a configuration file in yaml format.

Setting the publisher and replyer

The publisher and replyer is set in the following format (standard ports)

publisher: tcp://localhost:9999
replyer: tcp://localhost:9998

The format is defined by the underlying ZMQ networking library used

Setting the gesture mapping

Each gesture can trigger a sequence of actions. An action is either a normal key press (and release) or a hotkey (e.g. alt+f4).

The mapping to gestures is given as

  'Swipe R':
    - {type: hotkey, key: [ctrl, tab], delay: 2.0}
    - {type: press, key: f1, delay: 2.0}
    - {type: press, key: f11}
  'Swipe L': {type: hotkey, key: [ctrl, tab]}

In this example, a sequence of three key strokes is pressed after the gesture 'Swipe R' was recognized.

Key press actions are given as follows

{type: press, key: f1, delay: 2.0}

The delay field is optional and defines the delay in seconds before the next action in the sequence is triggered. This can be useful, if a second key needs to be pressed after a window has opened which takes some milliseconds.

Hotkey actions are defined as

{type: hotkey, key: [ctrl, tab], delay: 2.0}

Activation gesture

You can define an activation gesture that needs to be performed to activate the gesture control. Two modes are supported, activation for a certain period in time or a toggling of gesture control.

In both modes the activation gesture is given as e.g.,

activation_gesture: Rotate RL

If the activation gesture should enable gesture control for a certain period in time, this is given by

activation_window: 3.0

whereas the length of the period is given in seconds. In the example case, performing the gesture "Rotate RL" activates gesture control for 3s. Within this time window, command gestures that trigger actions can be performed. After the 3 seconds all gestures except "Rotate RL" are ignored.

If the activation_window option is not set, performing the activation gesture toggles gesture control i.e., the user can explicitely turn the gesture control on or off.

Gesture and key names

The names of the gestures are

'Swipe R'
'Swipe L'
'Rotate RL'
'Rotate LR'
'Circle R'
'Circle L'
'Check Mark'
'X Mark'
'Swipe Up'
'Swipe Down'
'Eartouch R'
'Eartouch L'

The abbreviations for the keys are given in the following list

['\t', '\n', '\r', ' ', '!', '"', '#', '$', '%', '&', "'", '(',
')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`',
'a', 'b', 'c', 'd', 'e','f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~',
'accept', 'add', 'alt', 'altleft', 'altright', 'apps', 'backspace',
'browserback', 'browserfavorites', 'browserforward', 'browserhome',
'browserrefresh', 'browsersearch', 'browserstop', 'capslock', 'clear',
'convert', 'ctrl', 'ctrlleft', 'ctrlright', 'decimal', 'del', 'delete',
'divide', 'down', 'end', 'enter', 'esc', 'escape', 'execute', 'f1', 'f10',
'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f2', 'f20',
'f21', 'f22', 'f23', 'f24', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9',
'final', 'fn', 'hanguel', 'hangul', 'hanja', 'help', 'home', 'insert', 'junja',
'kana', 'kanji', 'launchapp1', 'launchapp2', 'launchmail',
'launchmediaselect', 'left', 'modechange', 'multiply', 'nexttrack',
'nonconvert', 'num0', 'num1', 'num2', 'num3', 'num4', 'num5', 'num6',
'num7', 'num8', 'num9', 'numlock', 'pagedown', 'pageup', 'pause', 'pgdn',
'pgup', 'playpause', 'prevtrack', 'print', 'printscreen', 'prntscrn',
'prtsc', 'prtscr', 'return', 'right', 'scrolllock', 'select', 'separator',
'shift', 'shiftleft', 'shiftright', 'sleep', 'space', 'stop', 'subtract', 'tab',
'up', 'volumedown', 'volumemute', 'volumeup', 'win', 'winleft', 'winright', 'yen',
'command', 'option', 'optionleft', 'optionright']