Thread Tools Display Modes
01-19-23, 07:03 AM   #1
fatrog
A Fallenroot Satyr
Join Date: Nov 2022
Posts: 21
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?
  Reply With Quote
01-19-23, 04:18 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
You might want to look into frame:SetPropagateKeyboardInput().
__________________
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
01-19-23, 05:33 PM   #3
fatrog
A Fallenroot Satyr
Join Date: Nov 2022
Posts: 21
Thanks it worked
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » how to use OnKeyDown so it doesn't block other addon nor the game itself

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