-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGestureRecognizer.lua
53 lines (43 loc) · 1.04 KB
/
GestureRecognizer.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
scriptId = 'com.hritikaggarwal.myfirstscript'
-- domain
scriptTitle = "My First Script"
-- name of the script
scriptDetailsUrl = "hritikaggarwal.com"
-- website homepage for the product
function onPoseEdge(pose, edge)
if(pose == "doubleTap") then
myo.unlock("timed")
elseif (pose == "rest") then
-- Do nothing
else
if(edge == "on") then
-- myo.debug("onPoseEdge: " .. pose .. ", " .. edge)
sendMessage(pose .. "")
myo.lock()
end
end
end
function onPeriodic()
end
function onForegroundWindowChange(app, title)
-- myo.debug("onForegroundWindowChange: " .. app .. ", " .. title)
return true
end
function activeAppName()
return "Output Everything"
end
function onActiveChange(isActive)
-- myo.debug("onActiveChange")
end
function sendMessage(msg)
-- myo.debug(msg)
if (msg == "fist") then
myo.keyboard("1", "press")
elseif (msg == "waveOut") then
myo.keyboard("2", "press")
elseif (msg == "waveIn") then
myo.keyboard("3", "press")
elseif (msg == "fingersSpread") then
myo.keyboard("4", "press")
end
end