Thread Tools Display Modes
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
08-25-20, 09:55 AM   #2
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
PLAYER_STARTED_MOVING, PLAYER_STOPPED_MOVING events
  Reply With Quote
08-25-20, 10:11 AM   #3
waxballoon
A Defias Bandit
Join Date: Aug 2020
Posts: 2
Well, that's great and solves my problem, thank you!

For now I've mostly learnt from https://wow.gamepedia.com, https://wowwiki.fandom.com/ and random question answers that pop up from here whenever I search for a specific problem. Is there any other big resource that I'm missing on?

Last edited by waxballoon : 08-25-20 at 10:11 AM. Reason: grammar
  Reply With Quote
08-25-20, 03:34 PM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
The WoWWiki is not current, and hasn't been actively updated (iE: passive data scrapes) in years. Stick to Gamepedia. You can also check out https://www.townlong-yak.com/ Tools menu. I often refer to the FramesXML/Globalstrings.lua file amongst others.

Last edited by myrroddin : 08-25-20 at 03:36 PM. Reason: mentioned https://www.townlong-yak.com/
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Make frame register click and propagate it

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