WoW:API GetBindingText: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
<center>'''GetBindingText'''</center>
{{framexmlfunc|FrameXML/UIParent.lua}} __NOTOC__
 
 
text = GetBindingText(key,prefix)


Returns the (localized?) string value for the given key and prefix.  Essentially a glorified getglobal() function.
Returns the (localized?) string value for the given key and prefix.  Essentially a glorified getglobal() function.


----
 
;''Arguments''
== Parameters ==
=== Arguments ===


:(String key, String prefix)
:(String key, String prefix)


:;key : The name of the key (e.g. UP, SHIFT-PAGEDOWN)
:;key : String - The name of the key (e.g. "UP", "SHIFT-PAGEDOWN")
:;prefix : The prefix of the variable name you're looking for.  Usually "KEY_" or "BINDING_NAME_".
:;prefix : String - The prefix of the variable name you're looking for.  Usually "KEY_" or "BINDING_NAME_".


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


:value
:;value : String - The (localized?) value of the global variable composed of the prefix and key name you specified.  For example, "UP" and "KEY_" would return the value of the global variable KEY_UP which is "Up Arrow" in the english locale.  If the global variable doesn't exist for the combination specified, it appears to just return the key name you specified.


:;value : (string) The (localized?) value of the global variable composed of the prefix and key name you specified.  For example, "UP" and "KEY_" would return the value of the global variable KEY_UP which is "Up Arrow" in the english locale.  If the global variable doesn't exist for the combination specified, it appears to just return the key name you specified.
== Example ==


----
;''Example''
  val = GetBindingText("UP", "KEY_");
  val = GetBindingText("UP", "KEY_");
  -- val is "Up Arrow"
  -- val is "Up Arrow"
----
{{Template:WoW API}}

Revision as of 14:14, 5 September 2006

WoW API < GetBindingText

"I" iconThis function is implemented in Lua here FrameXML/UIParent.lua.


text = GetBindingText(key,prefix)

Returns the (localized?) string value for the given key and prefix. Essentially a glorified getglobal() function.


Parameters

Arguments

(String key, String prefix)
key
String - The name of the key (e.g. "UP", "SHIFT-PAGEDOWN")
prefix
String - The prefix of the variable name you're looking for. Usually "KEY_" or "BINDING_NAME_".

Returns

value
String - The (localized?) value of the global variable composed of the prefix and key name you specified. For example, "UP" and "KEY_" would return the value of the global variable KEY_UP which is "Up Arrow" in the english locale. If the global variable doesn't exist for the combination specified, it appears to just return the key name you specified.

Example

val = GetBindingText("UP", "KEY_");
-- val is "Up Arrow"