<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AWindowSetGameActionTrigger</id>
	<title>API:WindowSetGameActionTrigger - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AWindowSetGameActionTrigger"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowSetGameActionTrigger&amp;action=history"/>
	<updated>2026-10-17T17:53:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:WindowSetGameActionTrigger&amp;diff=30897&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowSetGameActionTrigger&amp;diff=30897&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:53Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Window}}&lt;br /&gt;
Binds a window to a key-binding action, so that the action&amp;#039;s key triggers the window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetGameActionTrigger(windowName, actionId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window.&lt;br /&gt;
;actionId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of a key-binding action, for example from &amp;lt;code&amp;gt;GetActionIdFromName&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;SystemData.Settings.Keybindings.*.id&amp;lt;/code&amp;gt;. 0 removes the binding.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Any action the window was bound to before is unbound first. With 0, no new binding is made.&lt;br /&gt;
* &amp;lt;code&amp;gt;actionId&amp;lt;/code&amp;gt; is truncated to a whole number. When the client registers or unregisters the binding it uses only the low 16 bits of the id.&lt;br /&gt;
* The stock action bars and morale bar use it to connect their buttons to the hotkeys (see the examples).&lt;br /&gt;
* The &amp;#039;&amp;#039;No window specified&amp;#039;&amp;#039; error exists in the client but cannot be raised: a missing name is replaced by an empty string first, which gives the &amp;#039;&amp;#039;does not exist&amp;#039;&amp;#039; error.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetGameActionTrigger&amp;#039;: Window %s does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetGameActionTrigger&amp;#039;: Window %s is currently locked and may not be modified from lua. ...&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This check never triggers in the current client. See [[API:WindowSetShowing|WindowSetShowing]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_actionbars/source/actionbutton.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetGameActionTrigger (windowName, GetActionIdFromName (actionButton:GetActionName ()))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_moralewindow/source/moralewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-- Bind the action buttons to the hotkey keyboard events.&lt;br /&gt;
local actionTrigger = SystemData.Settings.Keybindings.MORALE_BAR_1.id + moraleLevel - 1&lt;br /&gt;
WindowSetGameActionTrigger (moraleButton:GetName (), actionTrigger)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowSetGameActionData|WindowSetGameActionData]]&lt;br /&gt;
* [[API:GetActionIdFromName|GetActionIdFromName]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>