<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Keymon.refresh</id>
		<title>Keymon.refresh - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.easyuo.com/openeuo/wiki/index.php?action=history&amp;feed=atom&amp;title=Keymon.refresh"/>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Keymon.refresh&amp;action=history"/>
		<updated>2026-05-13T19:44:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Keymon.refresh&amp;diff=1228&amp;oldid=prev</id>
		<title>Ximan: /* Description */</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Keymon.refresh&amp;diff=1228&amp;oldid=prev"/>
				<updated>2011-01-09T03:59:35Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Description&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 03:59, 9 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot; &gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Description ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Description ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The keymon refresh method the state of every key necessary &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and determines &lt;/del&gt;which, if any, hotkey is currently pressed.&amp;#160; The keymon generator creates a string from the given table of hotkey=handlerfunction values to quickly assess if any handler should be called and passes this to [[loadstring]].&amp;#160; In the example above, the created internal function looks like:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The keymon refresh method &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;checks &lt;/ins&gt;the state of every key necessary &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to determine &lt;/ins&gt;which, if any, hotkey &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;combination &lt;/ins&gt;is currently pressed.&amp;#160; The keymon generator creates a string from the given table of hotkey=handlerfunction values to quickly assess if any handler should be called and passes this to [[loadstring]].&amp;#160; In the example above, the created internal function &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;used by refresh &lt;/ins&gt;looks like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; local gk = {getkey(&amp;quot;ALT&amp;quot;),getkey(&amp;quot;SHIFT&amp;quot;),getkey(&amp;quot;CTRL&amp;quot;),getkey(&amp;quot;J&amp;quot;),};&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; local gk = {getkey(&amp;quot;ALT&amp;quot;),getkey(&amp;quot;SHIFT&amp;quot;),getkey(&amp;quot;CTRL&amp;quot;),getkey(&amp;quot;J&amp;quot;),};&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	<entry>
		<id>http://www.easyuo.com/openeuo/wiki/index.php?title=Keymon.refresh&amp;diff=1203&amp;oldid=prev</id>
		<title>Ximan: Created page with &quot;== Calling Pattern == Call  local km = sl.keymon(t) later  keymon.refresh()  == Example ==   local t = {    ['ALT SHIFT J']= function() print('ALT SHIFT J') end,    ['CTRL J']   ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.easyuo.com/openeuo/wiki/index.php?title=Keymon.refresh&amp;diff=1203&amp;oldid=prev"/>
				<updated>2011-01-09T00:36:26Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Calling Pattern == Call  local km = sl.keymon(t) later  keymon.refresh()  == Example ==   local t = {    [&amp;#039;ALT SHIFT J&amp;#039;]= function() print(&amp;#039;ALT SHIFT J&amp;#039;) end,    [&amp;#039;CTRL J&amp;#039;]   ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Calling Pattern ==&lt;br /&gt;
Call&lt;br /&gt;
 local km = sl.keymon(t)&lt;br /&gt;
later&lt;br /&gt;
 keymon.refresh()&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
 local t = {&lt;br /&gt;
   ['ALT SHIFT J']= function() print('ALT SHIFT J') end,&lt;br /&gt;
   ['CTRL J']     = function() print('CTRL J')      end,&lt;br /&gt;
 }&lt;br /&gt;
 local km = sl.keymon(t)&lt;br /&gt;
 while true do&lt;br /&gt;
   km.refresh()&lt;br /&gt;
   wait(30)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 -&amp;gt; CTRL J&lt;br /&gt;
    ALT SHIFT J&lt;br /&gt;
    ALT SHIFT J&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The keymon refresh method the state of every key necessary and determines which, if any, hotkey is currently pressed.  The keymon generator creates a string from the given table of hotkey=handlerfunction values to quickly assess if any handler should be called and passes this to [[loadstring]].  In the example above, the created internal function looks like:&lt;br /&gt;
&lt;br /&gt;
 local gk = {getkey(&amp;quot;ALT&amp;quot;),getkey(&amp;quot;SHIFT&amp;quot;),getkey(&amp;quot;CTRL&amp;quot;),getkey(&amp;quot;J&amp;quot;),};&lt;br /&gt;
 if  gk[1] == true and gk[2] == true and gk[3] == false and gk[4] == true then return 1 &lt;br /&gt;
 elseif  gk[1] == false and gk[2] == false and gk[3] == true and gk[4] == true then return 2 &lt;br /&gt;
 end;&lt;br /&gt;
&lt;br /&gt;
The result of calling this function is used to look up and invoke the appropriate user supplied handler.  Refresh takes no arguments and normally returns no values.&lt;br /&gt;
&lt;br /&gt;
== Upon Error ==&lt;br /&gt;
&lt;br /&gt;
If one of the hotkey handler functions throws an error during evaluation, an unhandled exception will occur.  In versions 0.09+, any errors thrown will be caught at the keymon.refresh level and handled according to the operant error redirection mode.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]&lt;br /&gt;
&lt;br /&gt;
* [[case]]&lt;br /&gt;
&lt;br /&gt;
* [[chain]]&lt;br /&gt;
&lt;br /&gt;
* [[iterator]]&lt;br /&gt;
&lt;br /&gt;
* [[journal]]&lt;br /&gt;
&lt;br /&gt;
* [[keymon]]&lt;br /&gt;
&lt;br /&gt;
* [[machine]]&lt;br /&gt;
&lt;br /&gt;
* [[spin]]&lt;/div&gt;</summary>
		<author><name>Ximan</name></author>	</entry>

	</feed>