Thread Tools Display Modes
03-29-21, 12:02 PM   #1
Vinnesta
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 1
Bug with SetBinding and SaveBindings?

In my addon, I am trying to set a keybind for a function using the following two lines of code:

SetBinding("CTRL-G", "SOME_ACTION")
SaveBindings(GetCurrentBindingSet())

However when loading this code, the keybind profile automatically switches to the character-specific key bindings (from the account-wide profile I was using before). In addition, all the keybinds in the character profile are not bound to anything, i.e. it resets to an entirely blank profile, except for the command that I just bound with the code.

I have disabled every addon and made a test addon with literally just these two lines of code, and yet I still get this behavior.

Note that GetCurrentBindingSet() returns 1 (i.e. account keybindings) right before SetBinding() is called. I have also tried setting a mode of 1 or 2 in SetBinding, but it does not help.

Is anyone getting the same issue in 9.0.5?

UPDATE: I believe I have fixed this issue by loading the code only after the player is logged in - when using AceAddon this would be in the OnEnable() method, or alternatively by checking IsLoggedIn(). The problem is likely caused by the addon initializing before the keybinds are fully loaded by the game client.

Last edited by Vinnesta : 03-30-21 at 04:35 AM. Reason: Update
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Bug with SetBinding and SaveBindings?

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