-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.lua
More file actions
58 lines (48 loc) · 1.36 KB
/
Copy pathdata.lua
File metadata and controls
58 lines (48 loc) · 1.36 KB
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
local modifiers = { -- generated
{"CONTROL"},
{"SHIFT"},
{"ALT"},
{"CONTROL", "SHIFT"},
{"SHIFT", "CONTROL"},
{"CONTROL", "ALT"},
{"ALT", "CONTROL"},
{"SHIFT", "ALT"},
{"ALT", "SHIFT"},
{"CONTROL", "SHIFT", "ALT"},
{"CONTROL", "ALT", "SHIFT"},
{"SHIFT", "CONTROL", "ALT"},
{"SHIFT", "ALT", "CONTROL"},
{"ALT", "CONTROL", "SHIFT"},
{"ALT", "SHIFT", "CONTROL"},
}
local keybinds = {
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"mouse-button-1", "mouse-button-2", "mouse-button-3", "mouse-button-4", "mouse-button-5"
}
local function create(name, mods)
local key_name
local key_sequence
if mods then
key_name = table.concat(mods, "_") .. "_" .. name
key_sequence = table.concat(mods, " + ") .. " + " .. name
else
key_name = name
key_sequence = name
end
return {
type = "custom-input",
name = "core_input_" .. key_name,
key_sequence = key_sequence,
block_modifiers = false
}
end
local keybind_events = {}
for i = 1, #keybinds do
local bind = keybinds[i]
table.insert(keybind_events, create(bind))
for j = 1, #modifiers do
local mods = modifiers[j]
table.insert(keybind_events, create(bind, mods))
end
end
data:extend(keybind_events)