<?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%3ALCDRegisterEventHandler</id>
	<title>API:LCDRegisterEventHandler - 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%3ALCDRegisterEventHandler"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:LCDRegisterEventHandler&amp;action=history"/>
	<updated>2026-10-24T17:26:53Z</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:LCDRegisterEventHandler&amp;diff=30538&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:LCDRegisterEventHandler&amp;diff=30538&amp;oldid=prev"/>
		<updated>2026-10-16T19:46:11Z</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=LCD}}&lt;br /&gt;
Registers a Lua function that an LCD page calls when a game event fires.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LCDRegisterEventHandler(pageName, eventId, callbackName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;pageName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the page.&lt;br /&gt;
;eventId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The event, a &amp;lt;code&amp;gt;SystemData.Events&amp;lt;/code&amp;gt; value.&lt;br /&gt;
;callbackName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the Lua function to call, for example &amp;lt;code&amp;gt;&amp;quot;EA_LCDKeyboard.UpdateHP&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Each page can have one handler per event. If the page already has a handler for this event, the error below is logged and the old handler stays.&lt;br /&gt;
* Input events (event ids 4 to 21) are not accepted for LCD pages. For those the client logs &amp;lt;code&amp;gt;Warning: LCD pages (%s) do not handle input events, so the %s callback %s() will never be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* The handler receives the event&amp;#039;s normal arguments. The stock handler for &amp;lt;code&amp;gt;CHARACTER_QUEUE_UPDATED&amp;lt;/code&amp;gt; is declared as &amp;lt;code&amp;gt;UpdateServerQueueStatus(waitSeconds, queuePos, queueSize)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Remove a handler with [[API:LCDUnregisterEventHandler|LCDUnregisterEventHandler]].&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;LCDRegisterEventHandler&amp;#039;: Page &amp;#039;%s&amp;#039; does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;LCDRegisterEventHandler&amp;#039;: Page %s already has an event handler (%s) for event %d.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_lcdkeyboard/source/g15test.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LCDRegisterEventHandler( EA_LCDKeyboard.Page1, SystemData.Events.PLAYER_CUR_HIT_POINTS_UPDATED, &amp;quot;EA_LCDKeyboard.UpdateHP&amp;quot; )&lt;br /&gt;
LCDRegisterEventHandler( EA_LCDKeyboard.Page1, SystemData.Events.PLAYER_CUR_ACTION_POINTS_UPDATED, &amp;quot;EA_LCDKeyboard.UpdateAP&amp;quot; )&lt;br /&gt;
LCDRegisterEventHandler( EA_LCDKeyboard.Page1, SystemData.Events.PLAYER_CAREER_RESOURCE_UPDATED, &amp;quot;EA_LCDKeyboard.UpdateCareerPoints&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:LCDUnregisterEventHandler|LCDUnregisterEventHandler]]&lt;br /&gt;
* [[API:LCDSetButtonHandler|LCDSetButtonHandler]]&lt;br /&gt;
* [[API:RegisterEventHandler|RegisterEventHandler]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>