#Disable specific keybindings in combat

1 messages · Page 1 of 1 (latest)

grand ore
#

I am using a Razer Tartarus and where I have my map and bag keybindings, I tend to hit them a lot when running through my rotation. Is there a way I can disable both map and bag keybinding while in combat?

earnest saffron
#

no

glass topaz
#

You should be able to hook a script to it so that if you are in combat and open the bags or maps it instantly closes (you won't notice it's open). The keyword here is "should", not exactly sure how opening bags and maps is handled on an event level
I'm sure someone with some spare time on the hands can help you with that if you ask for it.
If not I'd be happy to help when I'm done with some of my own work later

#

But like Spaten said, you can't disable the keybinds themselfs

ashen sable
#

you just hook the OnShow handler of the bag frame

#

like ContainerFrameCombinedBags:HookScript("OnShow", function() if InCombatLockdown() then CloseAllBags() end end)

#

ContainerFrameCombinedBags being my bag frame, yours might be different

#

and instead of CloseAllBags() you can do ContainerFrameCombinedBags:Close() as well, which should actually be better

#

worth noting though that hooks are permanent until you reload or use SetScript

#

but I guess using SetScript on default frames is not a nice idea, don't know what you might mess up with that

tight lion
#

here u go

#

updated to toggle M and B key

ashen sable
#

No

ashen sable
#

For obvious reasons, it would allow huge amount of automation and trivialize combat

tight lion
#

did u test the wa?

#

works like a charm

ashen sable
#

no it does not for me

#

SetBinding is protected and can't be called in combat

#

not saying it didn't work for whatever you tested, but it doesn't for me and that's consistent with it being a protected function 🤷‍♂️

tight lion
#

how did u test it, so i can maybe reproduce it for me

grand ore
#

thank you

ashen sable
#

but if it works for the one that's concerned, whatever I guess