WoW:API GetBindingAction: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API GetBindingAction to API GetBindingAction without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<center>'''GetBindingAction'''</center>
{{wowapi}}
Returns the name of the action performed by the specified binding.
action = GetBindingAction("binding"[, checkOverride]);


Returns the name of the action performed by the specified ''key''.
==Arguments ==
;binding : String - The name of the key (eg. "BUTTON1", "1", "CTRL-G")
;checkOverride : Optional boolean - if true, override bindings will be checked, otherwise, only default (bindings.xml/SetBinding) bindings are consulted.


----
== Returns ==
;''Arguments''
; action : String - action command performed by the binding. If no action is bound to the key, an empty string is returned.
 
:(String key)
 
:;key : The name of the key (eg. BUTTON1, 1, CTRL-G)
 
----
;''Returns''
 
:action
 
:;action : The name of the action performed by the key. If no action is bound to the key, an empty string is returned.
 
----
;''Example''
 
action = GetBindingAction("UP");
DEFAULT_CHAT_FRAME:AddMessage("The up arrow is currently bound to:",1.0,1.0,1.0);
if (action) then DEFAULT_CHAT_FRAME:AddMessage(action,1.0,1.0,1.0); end
--By default this will return "MOVEFORWARD"
 
----
{{Template:WoW API}}

Latest revision as of 04:45, 15 August 2023

WoW API < GetBindingAction

Returns the name of the action performed by the specified binding.

action = GetBindingAction("binding"[, checkOverride]);

Arguments[edit]

binding
String - The name of the key (eg. "BUTTON1", "1", "CTRL-G")
checkOverride
Optional boolean - if true, override bindings will be checked, otherwise, only default (bindings.xml/SetBinding) bindings are consulted.

Returns[edit]

action
String - action command performed by the binding. If no action is bound to the key, an empty string is returned.