Showing posts with label synaptics. Show all posts
Showing posts with label synaptics. Show all posts

Wednesday, March 2, 2011

GlovePIE Script for simple touchpad gestures

GlovePIE only understands Synaptics touchpads, which means the external one we purchased isn't compatible. At least for PC's, most laptop touchpads are Synaptics and my beautiful script works nicely :) Copy and paste to GlovePIE and enjoy typing different letters by moving your finger in four directions:


Touchpad.swallow = true // Touchpad will have no effect on cursor

// This script is about making simple touchpad gestures produce keystrokes.

If Touchpad.FingerPresent = true then
var.touchlocx = touchpad.x
var.touchlocy = touchpad.y
wait 20 ms
If touchpad.x > (var.touchlocx + 0.05) then // Move finger right
Press K
Release K
ElseIf touchpad.x < (var.touchlocx - 0.05) then // Move finger left
Press J
Release J
ElseIf touchpad.y < (var.touchlocy - 0.05) then // Move finger up
Press U
Release U
ElseIf touchpad.y > (var.touchlocy + 0.05) then // Move finger down
Press I
Release I
EndIf
EndIF