Thread Tools Display Modes
Prev Previous Post   Next Post Next
02/15/20, 09:05 PM   #1
ShadowMau
AddOn Author - Click to view addons
Join Date: Oct 2018
Posts: 23
Help with keybindings not loading

I have been trying to figure this out, and it is probably something very simple that I am missing. I am writing a very simple addon the provides an example of how to add a keybind to controls. I have looked at several other addons as examples, and have gone so far as to copy and paste the content into my file. It still will not work. It appears that either my xml file has an error of some kind that I am missing, or the xml file is not loading at all. I have completely exited the client and launcher, and restarted the game in case that was causing an issue.

I have gone in to other people's addons and made changes (ie: adding my own command identical to what I am trying to accomplish in my addon). Those changes show up in the controls list and allow me to assign a key. When pressed, the key works as expected. I then copied the changed bindings.xml file back to my addon directory, trimmed the original out so all am left with is what I had added. Again it will not work (even though the exact same file worked in the other directory).

Thinking that my bindings.xml file was corrupted somehow, I have re-created the file several times. Have saved it as a plain txt file, then renamed it, and used copy and paste as well as just typing it all in fresh. Nothing is making any progress. I am using Notepad++ as my editor. However I have also recreated the files using the built in Windows notepad as well.

I added a slash command so I can check to make sure that my string id's are actually created. I tried a different string name (Yes I left the old one in) just in case I was colliding with some other addon or reserved keywords. Using the slash command, it shows that the string assignments have been made. Everything checks out, but the option does not show up under the controls. I used the color codes to make it show up more clearly, and the same color codes work fine when I modify other people's bindings.xml files. It is probably something stupid-simple, but what am I missing??


SimpleKeybind.txt
Code:
; This Add-on is not created by, affiliated with or sponsored by ZeniMax Media
; Inc. or its affiliates. The Elder Scrolls and related logos are registered
; trademarks or trademarks of ZeniMax Media Inc. in the United States and/or
; other countries. All rights reserved.
; https://account.elderscrollsonline.com/add-on-terms

## Title: |cff0000SimpleKeybind|r
## Description: Simple example keybind to get it to work
## Author: |cff38ffShadowMau|r
## Version: 0.0.1
## APIVersion: 100029


SimpleKeybind.lua
bindings.xml

SimpleKeybind.lua
Code:
SimpleKeybind = {}
SimpleKeybind.name = "SimpleKeybind"

local function simplekeybindtester()
	d("Simple Keybind Slash Command Test")
	d("Binding Name: " .. GetString(SI_BINDING_NAME_SKTEST))
	d("Eagle Binding: " .. GetString(SI_BINDING_NAME_EAGLE))
	d("Keybinding Layer: " ..GetString(SI_KEYBINDINGS_LAYER_GENERAL))
end


function SimpleKeybind.OnAddOnLoaded(event, addonName)
	if addonName == SimpleKeybind.name then
		ZO_CreateStringId("SI_BINDING_NAME_SKTEST", "|cEECA2ASimple Keybind|r")
		ZO_CreateStringId("SI_BINDING_NAME_EAGLE", "|cEECA2AEagle|r")
		SLASH_COMMANDS["/skt"] = simplekeybindtester

	
		-- No need to check any more
		EVENT_MANAGER:UnregisterForEvent(SimpleKeybind.name, EVENT_ADD_ON_LOADED)
	end
end

EVENT_MANAGER:RegisterForEvent(SimpleKeybind.name, EVENT_ADD_ON_LOADED, SimpleKeybind.OnAddOnLoaded)
bindings.xml
Code:
<Bindings>
	<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
		<Category name="|cEECA2ASimpleKeybind|r">
			<Action name="EAGLE">
				<Down>UseCollectible(267)</Down>
			</Action>
		</Category>
	</Layer>
</Bindings>

Last edited by ShadowMau : 02/15/20 at 09:09 PM. Reason: Fixed a spelling error
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Help with keybindings not loading


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off