So I've been at this for a few hours now and can't for the life of me find where I am messing up. I am new to the keybind strip, but I have followed the tutorial on the wiki as well as looked to other add-ons for proper implementations. The issue is that my keybind shows up on the keybind strip, with the proper name and everything, but it does absolutely nothing when I press the assigned button. I can't even get it to print back a test message in the chat window. I will post the related code here, if you need more info let me know and thanks in advance for taking a look!
main LUA file:
Code:
MI.KeybindStrip = {
{
alignment = KEYBIND_STRIP_ALIGN_LEFT,
name = "Add to Group",
keybind = "MI_ADD_TO_GROUP",
callback = function() d("test") end,
},
}
function MI.EditorChange(eventCode, oldMode, newMode)
if newMode == ZOS.HOUSING_EDITOR_MODE_PLACEMENT then
KEYBIND_STRIP:AddKeybindButtonGroup(MI.KeybindStrip)
else
KEYBIND_STRIP:RemoveKeybindButtonGroup(MI.KeybindStrip)
end
end
function MI.Setup()
ZO_CreateStringId("SI_BINDING_NAME_MI_ADD_TO_GROUP", "Add to Group")
EVENT_MANAGER:RegisterForEvent(MI.addonName, EVENT_HOUSING_EDITOR_MODE_CHANGED, MI.EditorChange)
EVENT_MANAGER:UnregisterForEvent(MI.addonName, EVENT_ADD_ON_LOADED)
end
function MI_ADD_TO_GROUP()
d("test")
end
bindings.xml
Code:
<Bindings>
<Layer name="SI_KEYBINDINGS_LAYER_USER_INTERFACE_SHORTCUTS">
<Category name="Move It">
<Action name="MI_ADD_TO_GROUP">
<Down> MI_ADD_TO_GROUP() </Down>
</Action>
</Category>
</Layer>
</Bindings>