WowAce.com
Home
Addons
Authors
Forums
Knowledge base
Paste
Site issues
Sign in
Register new account
LibKeyBound-1.0
Overview
Files
Tickets
Pages
Repository
Subscriptions
Curse
API
r3
Source
Markup:
*
These docs use [[Autodoc_Format|Autodoc]] for the [[LibKeyBound-1.0/API#API_Documentation|LibKeyBound API Documentation]] at the bottom. = Links = *Old Ace working docs: [http://old.wowace.com/wiki/LibKeyBound-1.0/API API] *[http://www.wowace.com/projects/libkeybound-1-0 LibKeyBound-1.0] *[http://forums.wowace.com/showthread.php?t=12823 LibKeyBound Forum] ==Functions you need to implement on your Button== ===Required=== <pre> button:GetHotkey() - returns the current hotkey assigned to the given button </pre> ===For a custom keybindings system=== <pre> button:SetKey(key) - binds the given key to the given button button:FreeKey(key) - unbinds the given key from all other buttons button:ClearBindings() - removes all keys bound to the given button button:GetBindings() - returns a string listing all bindings of the given button button:GetActionName() - what we're binding to, used for printing </pre> ==What your Mod has to do== ===Include the Library=== MyMod/libs svn:externals property: <pre> LibStub http://svn.wowace.com/wowace/tags/LibStub/1.0/ ... LibKeyBound-1.0 http://svn.wowace.com/wowace/trunk/LibKeyBound-1.0/LibKeyBound-1.0/ ... </pre> embeds.xml: <pre> <Script file="libs\LibStub\LibStub.lua"/> <Script file="libs\CallBackHandler-1.0\CallbackHandler-1.0.lua"/> <Include file="libs\LibKeyBound-1.0\lib.xml"/> </pre> MyMod.toc <pre> ## OptionalDeps: ...LibKeyBound-1.0... ## X-Embeds: ...LibKeyBound-1.0... </pre> ===Attach the LibKeyBound frame to your button on Mouse Enter=== <pre> local LibKeyBound = LibStub("LibKeyBound-1.0") ... function MyButtonClass:OnEnter() local button = this if (button.GetHotkey) then LibKeyBound:Set(button) end end </pre> ===Register and Respond to Events=== <pre> function MyMod:OnEnable(first) ... LibKeyBound.RegisterCallback(self, "LIBKEYBOUND_ENABLED") LibKeyBound.RegisterCallback(self, "LIBKEYBOUND_DISABLED") LibKeyBound.RegisterCallback(self, "LIBKEYBOUND_MODE_COLOR_CHANGED") end ... function MyMod:ColorMyMod() local overlayFrame = MyMod:GetOverlayFrame if (MyMod.keyBoundMode) then ... overlayFrame:SetBackdropColor(LibKeyBound:GetColorKeyBoundMode()) elseif (MyMod.someOtherMode) then ... end end function MyMod:LIBKEYBOUND_ENABLED() MyMod:OtherModeOff() MyMod.keyBoundMode = true MyMod:ColorMyMod() end function MyMod:LIBKEYBOUND_DISABLED() MyMod.keyBoundMode = nil MyMod:ColorMyMod() end function AutoBar:LIBKEYBOUND_MODE_COLOR_CHANGED() AutoBar:ColorMyMod() end </pre> ===Activate Key Binding Mode=== <pre> LibKeyBound:Activate() </pre> or <pre> LibKeyBound:Toggle() </pre> {{:API_Docs/LibKeyBound-1.0/LibKeyBound-1.0/LibKeyBound-1.0.lua}}
Markup Type:
*
The type of markup for this entry.
Click here for details
.
WikiCreole
BBCode
Safe HTML
Plain Text
Markdown
Textile
Curse Wiki (Deprecated)