Quantcast WoWInterface - View Single Post - OnKeyDown script while EditBox has focus
View Single Post
08-12-18, 11:07 AM   #3
JDoubleU00
A Scalebane Royal Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 441
Originally Posted by 7strm View Post
I'm trying to build a functionality that by pressing tab lets me cycle through channels (with ChatMenu_SetChatType?) while the editbox is open. Essentially like the Overwatch editbox, if you know how that one behaves.

However, while the edit box has focus, I can't seem to listen to keystrokes with an OnKeyDown script at all.

Do you have an idea how to work around this?

Code:
local ksf = CreateFrame("Frame")
ksf:SetFrameStrata("DIALOG")
ksf:EnableKeyboard()
ksf:SetPropagateKeyboardInput(true)
ksf:SetScript("OnKeyDown", function(key)
    print(key)
end)
This works only when the editbox does not have focus.
Great idea, I don't play Overwatch enough to realize it had that functionality.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote