Record button presses.
Is it possible to record button presses and then do something.
I mean something like If A button pressed and B button pressed then C button show. #See Below for working Code. The easiest way to get it to work is local button = CreateFrame("CheckButton", "ButtonName", FrameName, "UIPanelButtonTemplate") |
It's certainly possible but a bit more context about what you want to achieve might help you get some more specific information.
Edit: The most basic (rough as guts) is you have a frame with 3 buttons. In the OnClick event for button A and B. For A: Code:
self:GetParent().A_Clicked = true Code:
self:GetParent().B_Clicked = true |
If by button presses you mean keyboard key presses, the answer is yes and no.
There is api to detect specific key presses (mainly the CTRL/ALT/SHIFT modifiers) as well you can detect keybound key combinations. A generic key capturing solution is not trivial because making a frame that traps keyboard events generally means you lose control of the keyboard. In any case this is a good starting point to explore possibilities: Frame:EnableKeyboard() Be sure to read the 'small print' |
Quote:
A bit more for more context What I am trying to do is once someone selects the type of NPC they want to find (vendor trainer ect), and what City they are looking in (Stormwind, Thunder bluff ect) It will then either set a waypoint to that location Or if there are multiple allow the user to choose the NPC they want to visit. |
If anyone stumbles upon this Post there is the working code.
Code:
--parent frame |
All times are GMT -6. The time now is 11:37 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI