Thread Tools Display Modes
04/03/14, 11:23 AM   #1
FoleyX90
Join Date: Apr 2014
Posts: 9
If key is down?

I see in the documentation to set events for keyup / keydown but what I'm trying to do is simply check
if Key.IsDown(KEY_F)
or something similar. Does anybody know if this is possible? I don't want to have to create a new bind option because the key I'll be using is also used for other things and the context of it makes sense in this scenario (secondary interaction)
  Reply With Quote
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

ESOUI » AddOns » AddOn Help/Support » If key is down?

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