ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   EVENT_GLOBAL_MOUSE_DOWN button is always 65542 (https://www.esoui.com/forums/showthread.php?t=691)

Tingle0x539 04/08/14 08:29 AM

EVENT_GLOBAL_MOUSE_DOWN button is always 65542
 
The value on the EVENT_GLOBAL_MOUSE_DOWN variable "button" is always "65542", any reason for that? I'm trying to execute code on the middle mouse button but I'm unable to figure out how to do so. Any help?

Biki 04/08/14 08:40 AM

Lua Code:
  1. control:SetHandler("OnMouseUp", function(_, button)
  2.         if button == 3 then
  3.              -- your code
  4.         end
  5.   end)

Button 1 is left click, 2 is right click and 3 is middle click ;)

Tingle0x539 04/08/14 10:07 AM

I would like the event to happen no matter over what element I have hovered, what controller should I set this handle on? GuiRoot doesn't seem to do it. Is there some global mouse enabled controller I can use?

And btw, I just hooked the handler up to something so I can prototype a bit, and middle mouse button does not trigger the event.

Edit, eh ok - for some reason EVENT_GLOBAL_MOUSE_DOWN now returns the correct mouse key. 3 is middle in this case.

vapakule 04/08/14 04:54 PM

Hi, is there any event for Keyboard key down/up ?

Cr4x 04/08/14 06:02 PM

EVENT_GLOBAL_MOUSE_DOWN = 65542

http://wiki.esoui.com/Events

every event listed on that page, has always as first argument his own eventCode.

So
  • EVENT_GLOBAL_MOUSE_DOWN (integer button, bool ctrl, bool alt, bool shift, bool command)

should be used like that:

Lua Code:
  1. local function OnGlobalMouseDown(eventCode, button, ctrl, alt, _shift, command)
  2.     d("Someone pressed a button")
  3. end
  4.  
  5. EVENT_MANAGER:RegisterForEvent("MyAddOnName_EVENT_GLOBAL_MOUSE_DOWN", EVENT_GLOBAL_MOUSE_DOWN, OnGlobalMouseDown)

vapakule 04/09/14 01:28 AM

Quote:

Originally Posted by vapakule (Post 3397)
Hi, is there any event for Keyboard key down/up ?

can anyone help?

Xrystal 04/09/14 05:14 AM

Nope, no event starting with EVENT_KEY. But feel free to use the Wiki Event page to search more thoroughly yourself.


All times are GMT -6. The time now is 09:50 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI