-
Notifications
You must be signed in to change notification settings - Fork 6
/
remote.lua
113 lines (83 loc) · 1.73 KB
/
remote.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
local kb = libs.keyboard;
local server = require("server");
-- Documentation
-- http://www.unifiedremote.com/api
-- Keyboard Library
-- http://www.unifiedremote.com/api/libs/keyboard
-- OS Library
-- http://www.unifiedremote.com/api/libs/os
-- dialogs
actions.quitdialog = function ()
server.update({
type = "dialog",
text = "Are you sure you want to quit Anki?",
children = {
{ type = "button", text = "No" },
{ type = "button", text = "Yes", ontap = "quit" }
}
});
end
-- actions
actions.quit = function()
kb.stroke("ctrl", "q");
end
actions.launch = function ()
os.start("anki");
end
actions.overview = function()
kb.stroke("d");
end
actions.select_deck = function ()
kb.text(".");
end
actions.move_up = function ()
kb.press("up");
end
actions.move_down = function ()
kb.press("down");
end
actions.backspace = function ()
kb.press("backspace");
end
actions.escape = function ()
kb.press("escape");
end
actions.zoom_in = function ()
kb.stroke("ctrl", "kpadd");
end
actions.zoom_out = function ()
kb.stroke("ctrl", "kpsubtract");
end
actions.zoom_normal = function ()
kb.stroke("ctrl", "digit0");
end
actions.full_screen = function ()
kb.stroke("f11");
end
actions.repeat_media = function ()
kb.stroke("r");
end
actions.show_answer = function ()
kb.stroke("enter");
end
actions.rating_1 = function ()
kb.stroke("1");
end
actions.rating_2 = function ()
kb.stroke("2");
end
actions.rating_3 = function ()
kb.stroke("3");
end
actions.rating_4 = function ()
kb.stroke("4");
end
actions.mark = function ()
kb.text("*");
end
actions.suspend = function ()
kb.text("!");
end
actions.undo = function ()
kb.stroke("ctrl", "z");
end