Thread Tools Display Modes
01-03-11, 07:05 PM   #1
silentstone7
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 14
Setting Keybindings, need help!

I have an addon called Marking Bar that lets a player add raid target icons by targeting a mob, then clicking on the symbol they want to mark with. The addon itself works just fine, but I'm trying to add the ability to set keybindings.

There are already keybindings in the default kybinding list for all the raid markers, so I just need to call the SetBinding() function to assign the keybindings.

My problem is this: In my options panel, I want to let the user choose what key and/or key combination to press. How do I get this information, store it in a variable, and pass it to the SetBinding() function?

I'm also only using lua for my addon, so please no XML code.

Thanks in advance for any information or code you might be able to share!
  Reply With Quote
01-03-11, 08:04 PM   #2
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
use OnKeyDown or OnKeyUp to get the key pressed, and i think there is a "AltKeyPressed" or "AltKeyDown" etc for each modifier.

EDIT:
http://wowprogramming.com/docs/api/IsAltKeyDown

Last edited by kraftman : 01-03-11 at 08:09 PM.
  Reply With Quote
01-06-11, 03:20 AM   #3
silentstone7
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 14
That looks like what I need. Does anyone know where I can look to see an example of that in action?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Setting Keybindings, need help!


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