SetBinding issues
Hello.
I have used SetBinding to tie keystrokes to macros. These are saved in bindings-cache.wtf. If I change the binding key of a macro, the old binding is still present in this file, and I cannot get rid of it, or know what other bindings this macro has. The only solution is to manually delete bindings-cache.wtf. Is there an API I can use to delete all bindings present for a specific macro ? Thanks |
You can send nil as (or completely omitt) the second argument to SetBinding() to remove the key from all bindings.
I don't know if GetBinding() works on custom bindings. It might not. |
Thank you, however it is the opposite function I need,
1) delete all key-bindings for a specific macro without knowing how many bindings exit for that macro 2) delete all key-bindings for all macros |
Quote:
Quote:
There is a series of functions for override bindings, but that's a completely different system. |
On a similar note, I have a few macros like
Macro : "BOB" /cast [@mouseover] MySpell and then SetBinding("F1", "MACRO BOB"); Due to limited number of macros, is there a way to use SetBinding in a way similar to the pseudo-code below, so as to avoid creating a macro? -- this does not work SetBinding("F1", "/cast [@mouseover] MySpell"); |
Nope. The only way around it is to write addon code to create an ActionButton, then have the binding click it.
I'd probably use SetOverrideBinding*() so it doesn't clutter Bindings.wtf. The first argument to these functions is the binding's owner. This lets you manage bindings as a group. For example, you can use ClearOverrideBindings() to remove all bindings that are owned by a frame. Lua Code:
|
OK that worked thanks.
|
All times are GMT -6. The time now is 05:15 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI