-
Notifications
You must be signed in to change notification settings - Fork 0
/
modifiers.lua
45 lines (34 loc) · 1.08 KB
/
modifiers.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
local addon, dark_addon = ...
local modifiers = { }
function modifiers:shift()
return IsShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:control()
return IsControlKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:alt()
return IsAltKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:lshift()
return IsLeftShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:lcontrol()
return IsLeftControlKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:lalt()
return IsLeftAltKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:rshift()
return IsRightShiftKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:rcontrol()
return IsRightControlKeyDown() and GetCurrentKeyBoardFocus() == nil
end
function modifiers:ralt()
return IsRightAltKeyDown() and GetCurrentKeyBoardFocus() == nil
end
dark_addon.environment.hooks.modifier = setmetatable({}, {
__index = function(t, k)
return modifiers[k](t)
end
})