Thread Tools Display Modes
09-18-11, 02:36 PM   #1
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
Esc key tainted by addons...

I've noticed that some of the addons I use disable my ability to use the ESC key to perform normal blizzard actions. (ie: clear target, bring up game menu)

Now my own addon is doing it and I'd like to know why. A search on the forum for 'esc key', 'escape key' and 'esc' brought up a total of 3 posts, none of which address this issue.

Anyone know wtf this is all about?

WB
  Reply With Quote
09-18-11, 02:40 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
To start diagnosing taint issues, turn taint logging on.

/console taintLog 1

This will persist relogs/exits until you turn it off again.

When you have a taint.log in World of Warcraft/Logs we'll have more data to reach a conclusion.
  Reply With Quote
09-18-11, 02:46 PM   #3
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
Well, firstly, I am receiving no indication error for a taint, so I doubted I would get any results. This must not be a 'taint' as is defined by blizz, so perhaps i shouldve titled the post: 'Esc key broken by addons...'

Being a sport, I turned on logging anyway. Nothing logged.

After this clarification, any new support would be greatly appreciated.
  Reply With Quote
09-18-11, 02:53 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Try disabling your addons by halvsies to see which is causing it?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-18-11, 02:53 PM   #5
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
All are off cept mine.

Mine is a culprit, though certainly not the only one. I want to make it stop.

lol.
  Reply With Quote
09-18-11, 03:00 PM   #6
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
It probably has something to do with my displayed frame...??

I'm not able to get the following code to work:
Code:
gaFrame:SetScript("OnEscapePressed", function(self) self:Hide() end)
error: gaFrame doesn't have a "OnEscapePressed" script

do I need to do something obvious to get this to work right?
  Reply With Quote
09-19-11, 11:55 AM   #7
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Only EditBoxes have an OnEscapePressed-method.

If you want to hide your frame with ESC you have to name it (in the global namespace) and then insert into the UISpecialFrames-table.
__________________
Oh, the simulated horror!
  Reply With Quote
09-19-11, 02:05 PM   #8
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Take a look on these pages;

1. What script is supported by what objects:
http://wowprogramming.com/docs/scripts

2. Hierarchy diagram:
http://wowprogramming.com/docs/widgets_hierarchy

3. General documentation (index):
http://wowprogramming.com/docs
  Reply With Quote
09-19-11, 04:06 PM   #9
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Code:
table.insert(UISpecialFrames, yourframehere)
The Blizzard script that closes frames in the UISpecialFrames table uses a SecureCall, and thus shouldn't cause any taint even when the frame is tainted.
  Reply With Quote
09-19-11, 06:20 PM   #10
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by Haleth View Post
Code:
table.insert(UISpecialFrames, yourframehere)
The Blizzard script that closes frames in the UISpecialFrames table uses a SecureCall, and thus shouldn't cause any taint even when the frame is tainted.
It won't. I make several frames closable via this method, as do many other AddOn authors. In fact, it's the only real way to do this without taint.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
09-19-11, 11:48 PM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by Torhal View Post
Originally Posted by Haleth View Post
Code:
table.insert(UISpecialFrames, yourframehere)
The Blizzard script that closes frames in the UISpecialFrames table uses a SecureCall, and thus shouldn't cause any taint even when the frame is tainted.
It won't. I make several frames closable via this method, as do many other AddOn authors. In fact, it's the only real way to do this without taint.
Making a frame able to receive key events through frame:EnableKeyboard() then writing a script for the OnKeyUp or OnKeyDown handler to check the key argument passed for the Esc key also works. I've seen some Blizzard frames use this method too.

Code:
frame:EnableKeyboard(1);
frame:SetScript("OnKeyDown",function(self,key)
--	This can be checked for the ESC key, but we'll check for what the keybind uses
	if GetBindingFromClick(key)=="TOGGLEGAMEMENU" then
		self:Hide();
	end
end);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-21-11, 12:25 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Just as enabling the mouse on a frame will cause that frame to intercept all mouse clicks (eg. you can't have a frame that only responds to the right mouse button but lets left-clicks through to whatever's behind it), enabling the keyboard on a frame will cause that frame to intercept all keyboard input. That's why pressing non-character keys like Tab has no effect when the chat edit box is open.
  Reply With Quote
09-21-11, 07:02 PM   #13
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Should be able to be fixed with a call to frame:SetPropagateKeyboardInput(1) or setting the propagateKeyboardInput boolean attribute in XML. I'm not sure if it just propagates only through its parents or through all frames. I'll have to do some testing with it.

Edit1: This does indeed let keyboard events propagate into non-parent frames too.
Edit2: There seems to be some restrictions, when key events are propagated, only OnKeyDown fires and only for non-modifier keys.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 09-21-11 at 08:38 PM.
  Reply With Quote
10-05-11, 08:56 PM   #14
Schfiftyfive
A Kobold Labourer
Join Date: Oct 2011
Posts: 1
Hey buddy, I had this very same issue, and on my end it seemed to be a few addons that CAUSE the issue to START, however, I was able to leave my addons alone, and solve the problem, simply by opening my spellbook, and using escape to close it, and that seemed to restore functionality to my escape key, as far as being able to open my menu, clear targets, etc etc. I am a complete idiot as far as addons go, I can tell you, I read over this post, trying to find help as far as a simple fix to my issue, and was completely frustrated that the only responses that were given, were guys who had way more experience with coding and things than I do...the responses made very little sense to me, although I could grasp as much as the idea of binding a key to have a certain action which would clear a window, which was not my problem. I don't know if the actions that helped me have the effect of, I guess, re-familiarizing the interface with what is supposed to happen when esc is pressed, or even if that is possible for an interface to "re-learn" it's core functions, but I can tell you without a doubt, I still have the issue periodically when zoning, and I solve it every time by hitting "p" to open my book, then hit escape to close it, and that restores the function of my escape key. Hope this helps you /shrug.

-Five
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Esc key tainted by addons...

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