-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdzsubek.mailbox.myo
51 lines (43 loc) · 1.12 KB
/
dzsubek.mailbox.myo
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
scriptId = 'hu.dzsubek.myo.mailbox'
scriptTitle = "Mailbox app connectot"
scriptDetailsUrl = "http://myo.dzsubek.hu/mailbox"
function onForegroundWindowChange(app, title)
local isMailbox = platform == "MacOS" and app == "com.dropbox.mbd.external-beta"
return isMailbox
end
function activeAppName()
return "Mailbox (Beta)"
end
function archive()
myo.keyboard("return", "press")
end
function delete()
myo.keyboard("backspace", "press")
end
function conditionallySwapWave(pose)
if myo.getArm() == "left" then
if pose == "waveIn" then
pose = "waveOut"
elseif pose == "waveOut" then
pose = "waveIn"
end
end
return pose
end
function onPoseEdge(pose, edge)
if (pose == "waveIn" or pose == "waveOut") and edge == "on" then
pose = conditionallySwapWave(pose)
if pose == "waveIn" and edge == "on" then
archive()
end
if pose == "waveOut" and edge == "on" then
delete()
end
end
if pose == "doubleTap" and edge == "on" then
myo.lock()
end
end
function onUnlock()
myo.unlock("hold")
end