natask / gestures

Fluid gestures for Linux.
MIT License
67 stars 7 forks source link
finger-gestures fluid-gestures libinput-gestures tap-gestures touchpad touchscreen-gestures

+STARTUP: noinlineimages

+OPTIONS: toc:nil ^:nil

+html:

+html:

Gestures

+html:

Gesture Application for Linux supporting up to 5 finger gestures on Touchscreen and Touchpad.

+html:

+html:

+html:

+html:

+html:

+html:

+html:

+html:

+html:

+html:

+TOC: headlines 3

[[https://www.youtube-nocookie.com/embed/ckpyTz88pfE][gestures.png]]

Demonstrating fluid gestures, five finger gestures, tap gestures and touchscreen gestures.

Click to watch.

:END:

3 finger swipe

'3': { 't' : [], 'l' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup alt'], 'rep': ''}, 'r' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup alt'], 'rep': ''}, 'u' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+i'], 'rep': ''}, 'd' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+i'], 'rep': ''}, 'lu': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+shift+t'], 'rep': ''}, 'rd': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+w'], 'rep': ''}, 'ld': {'start': ['xdotool keydown control','xdotool key Page_Up'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Page_Up"], 'ru': ["xdotool key Page_Down"]}, 'end': ['xdotool keyup control'], 'rep': ''}, 'ru': {'start': ['xdotool keydown control','xdotool key Page_Down'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Page_Up"], 'ru': ["xdotool key Page_Down"]}, 'end': ['xdotool keyup control'], 'rep': ''} },

4 finger swipe

'4': { 't' : ['xdotool key super+w'], 'l' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Left'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'r' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Right'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'u' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Up'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'd' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Down'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'lu': {'start': [], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+shift+n'], 'rep': ''}, 'rd': {'start': [], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['save_and_close'], 'rep': ''}, 'ld': {'start': ['xdotool keydown alt','xdotool key Left'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Left"], 'ru': ["xdotool key Right"]}, 'end': ['xdotool keyup Alt'], 'rep': ''}, 'ru': {'start': ['xdotool keydown alt','xdotool key Right'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [],'ld': ["xdotool key Left"], 'ru': ["xdotool key Down"]}, 'end': [], 'rep': ''} },

5 finger swipe

'5': { 't' : ['open_dictionary'], 'l' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+2'], 'rep': ''}, 'r' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+1'], 'rep': ''}, 'u' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['toggle_global_window_switcher'], 'rep': ''}, 'd' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['flip'], 'rep': ''}, 'lu': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+1'], 'rep': ''}, 'rd': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['restartTouchpadAndPen'], 'rep': ''}, 'ld': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+3'], 'rep': ''}, 'ru': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['reset_keyboard'], 'rep': ''} } },

'pinch': {

i = in

o = out

2 finger pinch

'2': { 'i' : {'start': ['xdotool keydown control', 'xdotool key plus'], 'update': {'i': ['xdotool key plus'], 'o': ['xdotool key minus']}, 'end': ['xdotool keyup ctrl'], 'rep': ''}, 'o' : {'start': ['xdotool keydown control', 'xdotool key minus'], 'update': {'i': ['xdotool key plus'], 'o': ['xdotool key minus']}, 'end': ['xdotool keyup ctrl'], 'rep': ''} },

3 finger pinch

'3': { 'i' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} },

4 finger pinch

'4': { 'i' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} },

5 finger pinch

'5': { 'i' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} } } },

'touchscreen' :{ 'swipe': {

t = tap

l = left

r = right

u = up

d = down

lu = left_up

rd = right_down

ld = left_down

ru = right_up

3 finger swipe

'3': { 't' : ['xdotool key shift+Insert'], 'l' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup alt'], 'rep': ''}, 'r' : {'start': ['xdotool keydown alt', 'xdotool key Tab'], 'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup alt'], 'rep': ''}, 'u' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+i'], 'rep': ''}, 'd' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key super+i'], 'rep': ''}, 'lu': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+shift+t'], 'rep': ''}, 'rd': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+w'], 'rep': ''}, 'ld': {'start': ['xdotool keydown control','xdotool key Page_Up'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Page_Up"], 'ru': ["xdotool key Page_Down"]}, 'end': ['xdotool keyup control'], 'rep': ''}, 'ru': {'start': ['xdotool keydown control','xdotool key Page_Down'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Page_Up"], 'ru': ["xdotool key Page_Down"]}, 'end': ['xdotool keyup control'], 'rep': ''} },

4 finger swipe

'4': { 't' : ['xdotool key super+w'], 'l' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Left'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'r' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Right'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'u' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Up'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'd' : {'start': ['xdotool keydown ctrl+alt', 'xdotool key Down'],'update': {'l': ["xdotool key Left"], 'r': ["xdotool key Right"], 'u': ["xdotool key Up"], 'd': ["xdotool key Down"], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool keyup ctrl+alt'], 'rep': ''}, 'lu': {'start': [], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+shift+n'], 'rep': ''}, 'rd': {'start': [], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['save_and_close'], 'rep': ''}, 'ld': {'start': ['xdotool keydown alt','xdotool key Left'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': ["xdotool key Left"], 'ru': ["xdotool key Right"]}, 'end': ['xdotool keyup Alt'], 'rep': ''}, 'ru': {'start': ['xdotool keydown alt','xdotool key Right'], 'update': {'l' :[], 'r' :[], 'u': [], 'd': [], 'lu': [], 'rd': [],'ld': ["xdotool key Left"], 'ru': ["xdotool key Right"]}, 'end': [], 'rep': ''} },

5 finger swipe

'5': { 't' : ['open_dictionary'], 'l' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['emacsclient -c -a \"\"'], 'rep': ''}, 'r' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+alt+t'], 'rep': ''}, 'u' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['toggle_global_window_switcher'], 'rep': ''}, 'd' : {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['flip'], 'rep': ''}, 'lu': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['xdotool key ctrl+t'], 'rep': ''}, 'rd': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['restartTouchpadAndPen'], 'rep': ''}, 'ld': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['emacsclient -c -a \"\"'], 'rep': ''}, 'ru': {'start': [], 'update': {'l': [], 'r': [], 'u': [], 'd': [], 'lu': [], 'rd': [], 'ld': [], 'ru': []}, 'end': ['reset_keyboard'], 'rep': ''} } },

'pinch': {

i = in

o = out

2 finger pinch

'2': { 'i' : {'start': ['', ''], 'update': {'i': [''], 'o': ['']}, 'end': [''], 'rep': ''}, 'o' : {'start': ['', ''], 'update': {'i': [''], 'o': ['']}, 'end': [''], 'rep': ''} },

3 finger pinch

'3': { 'i' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} },

4 finger pinch

'4': { 'i' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} },

5 finger pinch

'5': { 'i' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''}, 'o' : {'start': ['', ''], 'update': {'i': [], 'o': []}, 'end': [], 'rep': ''} } } } }

+end_src

:END:

TOUCHPAD_CALIBRATION = 1 # scaling down for touchpad movements TOUCHSCREEN_CALIBRATION = 2 # scaling down for touchscreen movements

DECISION = 75 # sufficient movement to make decision on direction, scaled by the number of slots PINCH_DECISION = 160 #seems like x_cum and y_cum should got to around 0 if fingers moved symmetrically in or out #sufficient momvent to make pinch

ANGLE_X = 16 # angle to interpret as horizontal ANGLE_Y = 21 # angle to interpret as vertical

DEBOUNCE = 0.02 #sleep for 10 ms(now 40 ms), fastest tap around 25 ms, gotten from new_touch, touchpad data. in practice works well. THRESHOLD_SQUARED = 30 # threshold to be considered a move, squared sum of x and y PINCH_THRESHOLD = 100

REP_THRES = 0.2 #need to break this TIME before REP engages REP_DAG = 250 # REP on diagonal movement REP = 150 # REP for horizontal or veritical movement PINCH_REP = 40

DEADZONE_SQUARED = 1000 # deadzone where up until this, pinches aren't interpreted

+end_src

:END:

:END: ** DONE Write script to fulfill dependencies automatically CLOSED: [2020-02-04 Tue 23:35:22] :PROPERTIES: :ID: 6ed1e765-e89b-4649-be07-a95c3895698e :END: :RESOURCES: :END: :LOGBOOK: