# HG changeset patch # User Nenue # Date 1471498462 14400 # Node ID 9a9d7f2a7c0794a55fd95ec5d5015c44dad0a96e # Parent 83b941c7e2602d5ecd8a14bfd967f7dcbc94f0d6 - 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 diff -r 83b941c7e260 -r 9a9d7f2a7c07 SkeletonKey/ActionTemplates.lua --- 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}) diff -r 83b941c7e260 -r 9a9d7f2a7c07 SkeletonKey/BindingsFrame.lua --- 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 diff -r 83b941c7e260 -r 9a9d7f2a7c07 SkeletonKey/KeyButton.lua --- 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())