Key Binding?
So I have a really nice control I created id like to add key binding options to the Controls > Keybindings interface, and also have them preset with defaults. Obviously from a saved variable, but the commands to do this have been hard to find. I searched here and the api docs a few times with no luck. I was wondering if anyone had any tips on this? I know at least one addon had options for keybinding, but I don't remember which one so it will take me a while to find a example to learn from.
Also is there a way to see if a key is held down? |
|
Excellent thank you :)
|
So having some issues with this.
bindings.xml Code:
<Bindings> Lua Code:
This part seems to work as far as adding options to the keybindings menu.. function in main lua file Lua Code:
in txt file Code:
RiveMouseMod.lua 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? |
Ok I figured it out.
Code:
<Bindings> Code:
<Bindings> |
Still Need Default Key Bind help!!!
So I have created a really nice bag interface. and the above keybinding settings work well. However, there is a conflict between opening the default inventory, and opening my inventory.
The issue is, the default inventory is bound to B and I. If the user only binds B to my addon and hits I the default inventory still opens and steals back its children. This is avoidable if both B and I are bound to my addon. It would also improve the ease of use for my addon. I always like to reduce the amount of user configuration required for my projects. I need to find how to set my addon to have default keys bound to it. I do not want to use the xml onKeyDoan method listed here http://wiki.esoui.com/AddOn_Quick_Qu...an_tie_into.3F since it does not allow for a user to change the keys to open the interface. pluss I havnt been able to get it to not make the rest of the game unresponsive (which I believe is the point when a tlc is open). I have been through zgoo and the wikki many times now, and not found anything that would indicate a means of defining a default key for a control. I have been trying to get this working for the majority of the last week without any success. Any help would be greatly appreciated. |
You don't need to use the <OnKeyDown> or <OnKeyUp> events suggested in the Wiki. In fact, I would leave the hardcoded key press out all together. Let the user pick. The layer and category in the bindings.xml is were your custom key bind can be user set in the control menu of the game.
--halja |
Quote:
ZO_CreateStringId("SI_BINDING_NAME", "") or something similar |
Specifying Down/Up are for if you want something different to happen with each one. If you don't, you don't need it. (Or you can just pick one, whatever.)
From the API list in the wiki: CreateDefaultActionBind(string actionName, KeyCode key, KeyCode modifier1, KeyCode modifier2, KeyCode modifier3, KeyCode modifier4) |
There also is one to change them but I have not used it.
BindKeyToAction protected (luaindex layerIndex, luaindex categoryIndex, luaindex actionIndex, luaindex bindingIndex, KeyCode key, KeyCode modifier1, KeyCode modifier2, KeyCode modifier3, KeyCode modifier4) It references more the bindings.xml structure than the actions name. |
Quote:
Thank you very much. It looks like what I was in need of. |
Yeah... the ESO client seems to be a little... delicate. I've crashed it on several occasions. Most recently was this afternoon. I was trying to remember if tonumber() would work to strip a % from a number string. I put d(tonumber("13%)) into the chat, but, as you can see, forgot the closing quotes. Client crashed.
|
I've been trying to create a keybinding, but I'm having issues getting it to show up in the keybinding menu. I even switched Layer to general like you said you had to do.
This is my xml: Code:
<Bindings> Code:
ZO_CreateStringId("SI_BINDING_NAME_MAGIC", "magic") EDIT: Bahahaha, I wasn't including them in my txt file....wow. Okay. Anyway, I'd just like to thank everyone who has contributed to this thread. It's been helpful :) |
Daedros Endus,
Switch your layer name for the international string variable. Code:
<Bindings> -Cheers |
Quote:
|
np,
It tripped me up for a bit too. I kept bugging me it was working in English but not the other languages. Then it hit me as I was testing in German and noticed the text was changing for the titles and categories on the key-bind game menu. ZOS was using the xml attribute for the text. Switching back and forth I saw:
|
All times are GMT -6. The time now is 07:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI