WoW:API GetBindingKey: Difference between revisions
Jump to navigation
Jump to search
GetBindingKey
mNo edit summary |
m (Move page script moved page API GetBindingKey to API GetBindingKey without leaving a redirect) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{wowapi}} | |||
<center>'''GetBindingKey'''</center> | <center>'''GetBindingKey'''</center> | ||
Line 23: | Line 24: | ||
if (key1) then DEFAULT_CHAT_FRAME:AddMessage(key1,1.0,1.0,1.0); end | if (key1) then DEFAULT_CHAT_FRAME:AddMessage(key1,1.0,1.0,1.0); end | ||
if (key2) then DEFAULT_CHAT_FRAME:AddMessage(key2,1.0,1.0,1.0); end | if (key2) then DEFAULT_CHAT_FRAME:AddMessage(key2,1.0,1.0,1.0); end | ||
Latest revision as of 04:45, 15 August 2023
← WoW API < GetBindingKey
Returns all keys currently bound to the command specified by command. This function is almost identical to GetBinding(index) except it takes the command name as an argument instead of the index and doesn't return the command name along with the key bindings.
- Arguments
- (String command)
- command
- The name of the command to get key bindings for (e.g. MOVEFORWARD, TOGGLEFRIENDSTAB)
- Returns
- key1, key2, ..., keyN
- key1-N
- (string) The string representation of the key bound to this command (e.g. W, UP). Even though the default key binding GUI window only displays 2 possible keys bound to each command, it appears there is no limit to the number of keys that can be bound to a single command. This function will return as many keys as have been set with SetBinding("key"{,"command"}). If no keys are bound to the action, it will return nil.
- Example
key1, key2 = GetBindingKey("MOVEFORWARD"); DEFAULT_CHAT_FRAME:AddMessage("Move Forward has the following keys bound:",1.0,1.0,1.0); if (key1) then DEFAULT_CHAT_FRAME:AddMessage(key1,1.0,1.0,1.0); end if (key2) then DEFAULT_CHAT_FRAME:AddMessage(key2,1.0,1.0,1.0); end