|
2 | 2 | Keybinding Widget |
3 | 3 | Set Keybindings in the Config UI. |
4 | 4 | -------------------------------------------------------------------------------]] |
5 | | -local Type, Version = "Keybinding", 26 |
| 5 | +local Type, Version = "Keybinding", 27 |
6 | 6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
7 | 7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
8 | 8 |
|
@@ -31,12 +31,14 @@ local function Keybinding_OnClick(frame, button) |
31 | 31 | if self.waitingForKey then |
32 | 32 | frame:EnableKeyboard(false) |
33 | 33 | frame:EnableMouseWheel(false) |
| 34 | + frame:EnableGamePadButton(false) |
34 | 35 | self.msgframe:Hide() |
35 | 36 | frame:UnlockHighlight() |
36 | 37 | self.waitingForKey = nil |
37 | 38 | else |
38 | 39 | frame:EnableKeyboard(true) |
39 | 40 | frame:EnableMouseWheel(true) |
| 41 | + frame:EnableGamePadButton(true) |
40 | 42 | self.msgframe:Show() |
41 | 43 | frame:LockHighlight() |
42 | 44 | self.waitingForKey = true |
@@ -72,6 +74,7 @@ local function Keybinding_OnKeyDown(frame, key) |
72 | 74 |
|
73 | 75 | frame:EnableKeyboard(false) |
74 | 76 | frame:EnableMouseWheel(false) |
| 77 | + frame:EnableGamePadButton(false) |
75 | 78 | self.msgframe:Hide() |
76 | 79 | frame:UnlockHighlight() |
77 | 80 | self.waitingForKey = nil |
@@ -119,6 +122,7 @@ local methods = { |
119 | 122 | self:SetDisabled(false) |
120 | 123 | self.button:EnableKeyboard(false) |
121 | 124 | self.button:EnableMouseWheel(false) |
| 125 | + self.button:EnableGamePadButton(false) |
122 | 126 | end, |
123 | 127 |
|
124 | 128 | -- ["OnRelease"] = nil, |
@@ -195,10 +199,12 @@ local function Constructor() |
195 | 199 | button:SetScript("OnKeyDown", Keybinding_OnKeyDown) |
196 | 200 | button:SetScript("OnMouseDown", Keybinding_OnMouseDown) |
197 | 201 | button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel) |
| 202 | + button:SetScript("OnGamePadButtonDown", Keybinding_OnKeyDown) |
198 | 203 | button:SetPoint("BOTTOMLEFT") |
199 | 204 | button:SetPoint("BOTTOMRIGHT") |
200 | 205 | button:SetHeight(24) |
201 | 206 | button:EnableKeyboard(false) |
| 207 | + button:EnableGamePadButton(false) |
202 | 208 |
|
203 | 209 | local text = button:GetFontString() |
204 | 210 | text:SetPoint("LEFT", 7, 0) |
|
0 commit comments