Thread Tools Display Modes
02-07-06, 12:31 AM   #1
Critters
A Murloc Raider
Join Date: Oct 2005
Posts: 5
Intercepting mouse button events

Hi there,

Is anybody able to point me in the right direction here? What I am trying to do is intercept mouse button events (particularly the left and right mouse up events) that take place in the UIParent frame. I want to take action based on these events and then pass the event through to the underlying event handler intrinsic to the UIParent frame. What I have done so far is create a frame that is registered for the OnMouseUp event and have had this invisible frame fill the UIParent frame, but then the problem is that no mouse button related events are getting through to the UIParent frame.

The AutoBuff addon has exaclty the fuctionality that I am looking for in this regard, but I am not familiar enough with wow scripting to quite get my head around how the author is hooking into the events in question.

Can anybody point me in the right direction?

Thanks.

-Sheppe
  Reply With Quote
02-07-06, 12:45 AM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
You can't easily pick up mouse events via a frame and then 'pass them through' anywhere, it's generally easier in a case like yours, to hook the functions that the buttons are bound to, and do your work there.
  Reply With Quote
02-07-06, 01:25 AM   #3
Critters
A Murloc Raider
Join Date: Oct 2005
Posts: 5
Originally Posted by Iriel
You can't easily pick up mouse events via a frame and then 'pass them through' anywhere, it's generally easier in a case like yours, to hook the functions that the buttons are bound to, and do your work there.
Yes, I realize that. Any idea what the function names are? I haven't had a lot of luck tracking them down.

I should have elaborated that I attempted to hook into the UIParent:OnMouseUp event, but it consistently returns a nil value. In addition, the reason for the frame is because I have not been able to find another way to have the OnMouseUp event raised for my addon.

Cheers,

-Sheppe

Last edited by Critters : 02-07-06 at 01:27 AM.
  Reply With Quote
02-07-06, 11:31 AM   #4
Critters
A Murloc Raider
Join Date: Oct 2005
Posts: 5
I believe I found the functions to hook:

-- Left button click functions.
CameraOrSelectOrMoveStart
CameraOrSelectOrMoveStop

-- Right button click functions.
TurnOrActionStart
TurnOrActionStop

-Sheppe
  Reply With Quote
02-07-06, 02:43 PM   #5
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
Those look right (To verify look in your account key bindings then cross reference against FrameXML\Bindings.xml)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Intercepting mouse button events


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