WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   OnKeyDown script while EditBox has focus (https://www.wowinterface.com/forums/showthread.php?t=56500)

7strm 08-05-18 11:12 AM

OnKeyDown script while EditBox has focus
 
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.

MunkDev 08-05-18 02:47 PM

Lua Code:
  1. Editbox:SetScript("OnTabPressed", tabfunc)

JDoubleU00 08-12-18 11:07 AM

Quote:

Originally Posted by 7strm (Post 329319)
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.


All times are GMT -6. The time now is 07:46 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI