View Single Post
06/11/14, 01:24 PM   #1
ZunaSW
Join Date: Mar 2014
Posts: 37
Key Binding Problem

Hello all, sorry my english.

I'm now testing key bindings, and I readed a lot of them in the forums and in the wiki. I followed all the tutorials I found, and readed a lot of posts about them, but I can't make my key binding to work. I can select the key I want in the controls>key binding menu, but when I press the key I get this error:

Code:
:1: function expected instead of nil
stack traceback:
	:1: in function '(main chunk)'
Here is my bindings.xml

Code:
<Bindings>
  <Layer name="General">
    <Category name="Test">
      <Action name="TOGGLE_TEST">
        <Down>OnKeyDown()</Down>
      </Action>
    </Category>
  </Layer>
</Bindings>

bindings.lua

Code:
ZO_CreateStringId("SI_BINDING_NAME_TOGGLE_TEST", "Toggle Test")

And my addon lua

Code:
BindingTest= {}

BindingTest.name = "Binding Test"

local wm = GetWindowManager()
local test = wm:CreateTopLevelWindow(nil)
test:SetDimensions(128,256)
test:SetAnchor(BOTTOMRIGHT,GuiRoot,BOTTOMRIGHT,0,0)
testb = wm:CreateControl(nil, test, CT_TEXTURE)
testb:SetTexture("BindingTest/textures/test.dds")
testb:SetAnchorFill(test)
testb:SetHidden(true)

function BindingTest.OnKeyDown()
		testb:SetHidden(false)
end
Where I'm failing? Thank you ^^
  Reply With Quote