WoW:API SetConsoleKey: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(upgraded deprecated template)
m (Move page script moved page API SetConsoleKey to API SetConsoleKey without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
{{stub/api}}


Calling this function with no parameters appears to unbind the console key (normally the "`" key) for the duration of the WoW session.
Sets the key used to open the console overlay for the current session.  Upon restarting the game, the console key will return to the default "`" (tilde) key.


Calling this function with a parameter indicating the a new keybinding to set the Console Key to will rebind the console keybinding for the duration of the WoW session; however, unlike the analogous argument for [[API SetBinding|SetBinding()]], it appears that you can ''only'' provide the values of keys that represent standard ASCII characters--no modifiers or other special keys are allowed.  For instance, <tt>SetConsoleKey("CTRL-F")</tt> won't work, but <tt>SetConsoleKey("F")</tt> will.
''Note that the console is only accessible when WoW is started with the "-console" parameter, and that this function does nothing if the parameter wasn't used.''


However, it should be noted that the console key is a very special keybinding in WoW; whenever the bound key is pressed, ''regardless'' of context or mode, the console window will appear (or disappear, if it's already visible).  This means that setting the console key to "F" will ''prevent you from ever generating the 'F' character again'', even if it's in a chat window or within the console itself.
SetConsoleKey("key")
== Parameters ==
=== Arguments ===
:("key")


Using [[API SaveBindings|SaveBindings()]] does not appear to permanently save this particular binding to disk.
:;key : String - The character to bind to opening the console overlay.  When set to ''nil'', the console binding gets removed.


'''NB''' as of [[Patch_0.11_(Release_Notes)|Patch 0.11]], the console is no more accessible.
 
== Details ==
Unlike the analogous [[API SetBinding|SetBinding()]] function, you can ''only'' provide the values of keys that represent standard ASCII characters--no modifiers are allowed.  For instance, <tt>SetConsoleKey("CTRL-F")</tt> won't work, but <tt>SetConsoleKey("F")</tt> will.  In addition, non-alphabetic keys that require modifiers to access, such as <tt>"!"</tt> using &lt;Shift+1&gt;, cannot be used.
 
It should be noted that the console key is a very special keybinding in WoW; whenever the bound key is pressed, ''regardless'' of context or mode, the console window will appear (or disappear, if it's already visible).  This means that setting the console key to <tt>"F"</tt> will ''prevent you from ever generating the <tt>"F"</tt> character again'', even if it's in a chat window or within the console itself.
 
Using [[API SaveBindings|SaveBindings()]] does not permanently save this particular binding to disk.

Latest revision as of 04:47, 15 August 2023

WoW API < SetConsoleKey

Sets the key used to open the console overlay for the current session. Upon restarting the game, the console key will return to the default "`" (tilde) key.

Note that the console is only accessible when WoW is started with the "-console" parameter, and that this function does nothing if the parameter wasn't used.

SetConsoleKey("key")

Parameters

Arguments

("key")
key
String - The character to bind to opening the console overlay. When set to nil, the console binding gets removed.


Details

Unlike the analogous SetBinding() function, you can only provide the values of keys that represent standard ASCII characters--no modifiers are allowed. For instance, SetConsoleKey("CTRL-F") won't work, but SetConsoleKey("F") will. In addition, non-alphabetic keys that require modifiers to access, such as "!" using <Shift+1>, cannot be used.

It should be noted that the console key is a very special keybinding in WoW; whenever the bound key is pressed, regardless of context or mode, the console window will appear (or disappear, if it's already visible). This means that setting the console key to "F" will prevent you from ever generating the "F" character again, even if it's in a chat window or within the console itself.

Using SaveBindings() does not permanently save this particular binding to disk.