Thread Tools Display Modes
04/15/14, 12:56 PM   #1
Artajörn
Join Date: Apr 2014
Posts: 19
Exclamation My key binding doesn't work.

Hi,

I'm trying to implement a key binding system in my add-on, but it doesn't work. This is the code I have:

Bindings.xml
Code:
<Bindings>
	<Layer name="Improved">
		<Category>
			<Action name="ITESO_TOGGLE_DISPLAY_MENU_WINDOW">
				<Down>ITESO.ToggleDisplayMenuWindow()</Down>
			</Action>
			<Action name="ITESO_TOGGLE_DISPLAY_HELM">
				<Down>ITESO.ToggleDisplayHelm()</Down>
			</Action>
		</Category>
	</Layer>
</Bindings>
Bindings.lua
Code:
ZO_CreateStringId("SI_BINDING_NAME_ITESO_TOGGLE_DISPLAY_MENU_WINDOW", "Toggle Display Menu Window")
ZO_CreateStringId("SI_BINDING_NAME_ITESO_TOGGLE_DISPLAY_HELM", "Toggle Display Helm")
I hope you can help me.

Regards and thanks in advance.

Last edited by Artajörn : 04/15/14 at 01:04 PM.
  Reply With Quote
04/15/14, 01:11 PM   #2
Halja
 
Halja's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 111
ZOS is using the name attributes of the bindings XML to build the game menu for key binding settings. The layer name must become "General" in the language of the player.
English -- German -- French
"General" = "Allgemein" = "Général"

Use the localization string variables. The "SI_" table is global for all internationalized strings. I know you can customize the category but I don't think you can not have the name attribute.

Your bindings file should end up looking something like this:
Code:
<Bindings>
	<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
		<Category name="SI_KEYBINDINGS_CATEGORY_USER_INTERFACE">
			<Action name="ITESO_TOGGLE_DISPLAY_MENU_WINDOW">
				<Down>ITESO.ToggleDisplayMenuWindow()</Down>
			</Action>
			<Action name="ITESO_TOGGLE_DISPLAY_HELM">
				<Down>ITESO.ToggleDisplayHelm()</Down>
			</Action>
		</Category>
	</Layer>
</Bindings>
That should get the binding to at least show in the command key binding list and you just need to make sure you function is working from there.
--halja
  Reply With Quote
04/15/14, 02:29 PM   #3
Artajörn
Join Date: Apr 2014
Posts: 19
It worked! Thank you very much friend, you have saved me. ^^
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » My key binding doesn't work.

Thread Tools
Display Modes

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