Thread: Key Binding?
View Single Post
04/08/14, 06:48 AM   #4
tiomun
 
tiomun's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 25
So having some issues with this.

bindings.xml
Code:
<Bindings>
	<Layer name="|cFF8C00Rive|r Mouse Mod">
		<Category name="General Options">
			<Action name="RMM_MOUSE_MOD_ENABLE">
				<Down>RMM_ToggleEnabled()</Down>
			</Action>
		</Category>
	</Layer>
</Bindings>
Bindings.lua
Lua Code:
  1. ZO_CreateStringId("SI_BINDING_NAME_RMM_MOUSE_MOD_ENABLE", "Toggle Mouse Mod on/off")

This part seems to work as far as adding options to the keybindings menu..

function in main lua file
Lua Code:
  1. function RMM_ToggleEnabled()
  2.     rmm_data.AddonEnabled = not rmm_data.AddonEnabled
  3.     if rmm_data.AddonEnabled == false then
  4.         d("Disabled " .. rmm_name)
  5.     else
  6.         d("Enabled " .. rmm_name)
  7.     end
  8. end

in txt file
Code:
RiveMouseMod.lua

lib/LibStub/LibStub.lua
lib/LibAddonMenu-1.0/LibAddonMenu-1.0.lua

bindings/bindings.xml
bindings/Bindings.lua
RiveMouseMod.xml
So the issue is, when I assign a key to bind it doesn't seem to fire the function in the main lua file...
Not sure why its not working. Even comparing it to other addons it looks fine, I think.

Also is there a way to set a default key to be bound?
  Reply With Quote