WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   how to use OnKeyDown so it doesn't block other addon nor the game itself (https://www.wowinterface.com/forums/showthread.php?t=59477)

fatrog 01-19-23 07:03 AM

how to use OnKeyDown so it doesn't block other addon nor the game itself
 
Hello,

I have this part in my addon

Lua Code:
  1. local function onKeyDown(self, key)
  2.     -- code
  3. end
  4.  
  5. local frame = CreateFrame("Frame")
  6. frame:EnableKeyboard(true)
  7. frame:SetScript("OnKeyDown", onKeyDown)

Obviously, as it is written down in the api, it block everything else to use keyboard events. So, what is the method to know what key is pressed without blocking everything?

SDPhantom 01-19-23 04:18 PM

You might want to look into frame:SetPropagateKeyboardInput().

fatrog 01-19-23 05:33 PM

Thanks it worked :)


All times are GMT -6. The time now is 05:08 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI