Thread: If key is down?
View Single Post
04/09/14, 02:53 PM   #2
vapakule
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Lightbulb

Hi FoleyX90,
i have only one solution, regarding this example on wiki
http://wiki.esoui.com/AddOn_Quick_Qu...an_tie_into.3F

bindings.xml
Lua Code:
  1. <Bindings>
  2.   <Layer name="SI_LAYER_NAME_STRING">
  3.     <Category name="SI_CATEGORY_NAME_STRING">
  4.       <Action name="TURN_RIGHT">
  5.         <Down>OnKeyDown()</Down>
  6.         <Up>OnKeyUp()</Up>
  7.       </Action>
  8.     </Category>
  9.   </Layer>
  10. </Bindings>
This creates a section in the ESC->Controls->Keybindings settings where you need to bind keys, before you can trigger key up/down events.

lua:
Lua Code:
  1. ZO_CreateStringId("SI_BINDING_NAME_TURN_RIGHT", "Turn Right")
After that you can call any func you whant

Lua Code:
  1. function MyAddnon.OnKeyDown()
  2.   --do somtehing
  3. end
  4. function MyAddnon.OnKeyUp()
  5.   --do somtehing
  6. end

i hope it will help,Good luck!

Last edited by vapakule : 04/09/14 at 02:57 PM.
  Reply With Quote