WoW:API GetBindingAction: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
Line 1: Line 1:
<center>'''GetBindAction''' ''-Documentation by Sn3b-''</center>
<center>'''GetBindingAction'''</center>


Returns the name of the action performed by a specific key passed as argument.
Returns the name of the action performed by the specified ''key''.
 
GetBindingAction();


----
----
;''Arguments''
;''Arguments''


:String - name of the key (eg. BUTTON1, 1, A)
:(String key)


----
:;key : The name of the key (eg. BUTTON1, 1, CTRL-G)
;''Example''
 
strMouseActionButton1 = GetBindingAction("BUTTON1");
message(strMouseActionButton1);
 
This will display a message with the name of the action triggered when the left mouse button is pressed. In this case GetBindingAction() returns CAMERAORSELECTORMOVE.


----
----
;''Returns''
;''Returns''


:String - name of the action
:action
 
:;action : The name of the action performed by the key.  If no action is bound to the key, an empty string is returned.


----
----
;''Description''
;''Example''


: Returns the name of the action performed by a specific key passed as argument.
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}}
{{Template:WoW API}}
--[[User:Sn3b|Sn3b]] 16:20, 01 Mar 2005 (EST)

Revision as of 02:17, 21 July 2005

GetBindingAction

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


Arguments
(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