Thread Tools Display Modes
04/08/14, 08:29 AM   #1
Tingle0x539
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 25
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?
  Reply With Quote
04/08/14, 08:40 AM   #2
Biki
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 34
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
  Reply With Quote
04/08/14, 10:07 AM   #3
Tingle0x539
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 25
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.

Last edited by Tingle0x539 : 04/08/14 at 11:06 AM.
  Reply With Quote
04/08/14, 04:54 PM   #4
vapakule
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Hi, is there any event for Keyboard key down/up ?
  Reply With Quote
04/08/14, 06:02 PM   #5
Cr4x
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
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)
  Reply With Quote
04/09/14, 01:28 AM   #6
vapakule
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Originally Posted by vapakule View Post
Hi, is there any event for Keyboard key down/up ?
can anyone help?
  Reply With Quote
04/09/14, 05:14 AM   #7
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Nope, no event starting with EVENT_KEY. But feel free to use the Wiki Event page to search more thoroughly yourself.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » EVENT_GLOBAL_MOUSE_DOWN button is always 65542


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