Mercurial > wow > skeletonkey
changeset 49:9a9d7f2a7c07
- handle mouse input with string.upper
- process input for the whole bindings frame region when a slot is activated
- fix various errors arising from handler inconsistencies
author | Nenue |
---|---|
date | Thu, 18 Aug 2016 01:34:22 -0400 |
parents | 83b941c7e260 |
children | 1aba8a6fd4a9 |
files | SkeletonKey/ActionTemplates.lua SkeletonKey/BindingsFrame.lua SkeletonKey/KeyButton.lua |
diffstat | 3 files changed, 27 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/SkeletonKey/ActionTemplates.lua Tue Aug 16 11:59:24 2016 -0400 +++ b/SkeletonKey/ActionTemplates.lua Thu Aug 18 01:34:22 2016 -0400 @@ -408,7 +408,7 @@ kb.SecureAttribute = function(target, name, value) if InCombatLockdown() then if #kb.pendingAttributes == 0 then - kb:Print(kb.L('Key bindings will be applied when you exit combat.')) + kb:print(kb.L('Key bindings will be applied when you exit combat.')) end tinsert(kb.pendingAttributes, {target, name, value})
--- a/SkeletonKey/BindingsFrame.lua Tue Aug 16 11:59:24 2016 -0400 +++ b/SkeletonKey/BindingsFrame.lua Thu Aug 18 01:34:22 2016 -0400 @@ -57,12 +57,11 @@ local saveButton local KeyButton_OnKeyDown = function(self, key) - if key == 'ESCAPE' or key:match('[RL]SHIFT') or key:match('[RL]ALT') or key:match('[RL]CTRL') then - return - end kb.saveTarget.border:SetColorTexture(1,1,1,1) end local KeyButton_OnKeyUp = function(self, key) + + kb.UpdateSlot(kb.saveTarget) if key == 'ESCAPE' then kb.DeactivateSlot(kb.saveTarget) kb.ui() @@ -71,15 +70,18 @@ if key:match('[RL]SHIFT') or key:match('[RL]ALT') or key:match('[RL]CTRL') then return + elseif kb.saveTarget then + + if kb.SaveSlot(kb.saveTarget, key) then + if not (kb.db.stickyMode or kb.db.hoverInput) then + + kb.DeactivateSlot(kb.saveTarget) + end + kb.ui() + end end - if kb.SaveSlot(kb.saveTarget, key) then - if not (kb.db.stickyMode or kb.db.hoverInput) then - kb.DeactivateSlot(kb.saveTarget) - end - kb.ui() - end end local KeyButton_OnClick = function(self, click) @@ -103,6 +105,15 @@ elseif click == 'RightButton' then kb.ReleaseSlot(self) kb.ui() + elseif kb.saveTarget then + + if kb.SaveSlot(kb.saveTarget, string.upper(click)) then + if not (kb.db.stickyMode or kb.db.hoverInput) then + + kb.DeactivateSlot(kb.saveTarget) + end + kb.ui() + end end end @@ -389,8 +400,9 @@ kb.ActivateSlot = function(button) kb.saveTarget = button - kb:SetScript('OnKeyUp', KeyButton_OnKeyUp) - kb:SetScript('OnKeyDown', KeyButton_OnKeyDown) + kb:SetScript('OnKeyUp', function(self, key) KeyButton_OnKeyUp(button, key) end) + kb:SetScript('OnKeyDown', function(self, key) KeyButton_OnKeyDown(button, key) end) + kb:SetScript('OnMouseUp', function(self, key) KeyButton_OnKeyUp(button, key) end) kb.savingText:ClearAllPoints() kb.savingText:SetParent(button) kb.savingText:SetPoint('BOTTOMLEFT', button, 'TOPLEFT', 0, 0) @@ -400,6 +412,7 @@ kb.saveTarget = nil kb:SetScript('OnKeyUp', nil) kb:SetScript('OnKeyDown', nil) + kb:SetScript('OnMouseUp', nil) end
--- a/SkeletonKey/KeyButton.lua Tue Aug 16 11:59:24 2016 -0400 +++ b/SkeletonKey/KeyButton.lua Thu Aug 18 01:34:22 2016 -0400 @@ -302,8 +302,8 @@ self.binding = binding - - SetBinding(binding, self.command) + print('SetBinding', binding, self.command) + SetBinding(self.binding, self.command) SaveBindings(GetCurrentBindingSet())