View Single Post
08-25-20, 08:06 AM   #1
waxballoon
A Defias Bandit
Join Date: Aug 2020
Posts: 2
Make frame register click and propagate it

Hi, I'm new to writing code in LUA and using the WoW API. I'm trying to build a small addon that keeps track of my gold on various characters / servers.
I'd like to make the visible frame in which I show the data partially transparent whenever a user start moving, either though keyboard press or a mouse click (middle or left and right simultaneously).
I've found out how to register and propagate keyboard clicks but while I have found "OnMouseDown" and "OnMouseUp" for mouse clicks I can't seem to register the clicks without preventing them to do any other action.
I have first tried just to use `SetScript` on my own frame and then since I wanted to register clicks anywhere on the screen that started movement I tried `HookScript` on the UIParent. As I previously mentioned this blocked any other click action.
I would like to just be able to notice that the user has started moving through the mouse clicks and use those as trigger to modify the alpha, without preventing other actions.
Does someone know how I can obtain the desired behavior?
Thank you in advance!

Edit: I encountered problems even with keyboard events since propagating the clicks prevents me from using "OnKeyUp" and therefore knowing when the user has stopped inputting movement.
Is there an all together simpler solution for detecting player movement?

Last edited by waxballoon : 08-25-20 at 09:18 AM. Reason: Additional problem
  Reply With Quote