<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to keyconf.lua</title><link>https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/</link><description>Recent changes to keyconf.lua</description><atom:link href="https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 26 Oct 2012 04:21:00 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage keyconf.lua modified by Björn Ståhl</title><link>https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/</link><description>&lt;pre&gt;--- v3
+++ v4
@@ -46,7 +46,7 @@
 keyname sets the name of the lua script that will be used to load/save the keyconf as.
 ~~~~
 
-**Table methods (invoke with :) **
+**Table methods **
 
 name | args | returns | description
 ---- | ---- | ------- | -----------
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn Ståhl</dc:creator><pubDate>Fri, 26 Oct 2012 04:21:00 -0000</pubDate><guid>https://sourceforge.net47b6380dde7a0c32f19f9b35b22c671b144b4ae9</guid></item><item><title>WikiPage keyconf.lua modified by Björn Ståhl</title><link>https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/</link><description>&lt;pre&gt;--- v2
+++ v3
@@ -32,8 +32,11 @@
         
     end
 end
+
 ~~~~
 
+
+The keyconf/ledconf/listview and similar support script all use the LUA pseudo-OO table approach. The construction function looks like:
 
 ~~~~
 ::lua
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn Ståhl</dc:creator><pubDate>Fri, 26 Oct 2012 04:20:44 -0000</pubDate><guid>https://sourceforge.nete85a37111948882baa4164148d911b2d8d46e5ea</guid></item><item><title>WikiPage keyconf.lua modified by Björn Ståhl</title><link>https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -34,6 +34,7 @@
 end
 ~~~~
 
+
 ~~~~
 ::lua
 function keyconf_create(menugroup, playergroup, keyname)
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn Ståhl</dc:creator><pubDate>Fri, 26 Oct 2012 04:19:34 -0000</pubDate><guid>https://sourceforge.net43fe2d56ddfb0b15361eda0a88f525f76ae41557</guid></item><item><title>WikiPage keyconf.lua modified by Björn Ståhl</title><link>https://sourceforge.net/p/arcanfe/wiki/keyconf.lua/</link><description>Keyconf
-----

This script is used to help query the user for all different kinds of weird input devices.
The basic pattern used looks somewhat like:

~~~~
::lua

system_load("scripts/keyconf.lua")();

-- three labels to configure (the script will forcibly inject MENU_ESCAPE)
-- r as a first character indicates a REQUIRED label, empty space is optional
-- and a means an analog input.
labels = {"rKEYLABEL_A", " KEYLABEL_B", "aKEYLABEL_C"};

-- prepare a keyconfig that support the specified set of labels (could be nil and get a default one)
keyconfig = keyconf_create(labels);

-- if active, then there's nothing needed to be done, else we need a UI to help.
if (keyconfig.active == false) then
    keyconfig:to_front();

    oldinput = themename_input;
    themename_input = function(iotbl)

-- returns true if done, false if more input is needed
        if (keyconfig:input(iotbl) == true) then
-- here would be a good place to run other translations needed (e.g. keyconf_mame)
            themename_input = oldinput;            
        end
        
    end
end
~~~~

~~~~
::lua
function keyconf_create(menugroup, playergroup, keyname)
setting any of these arguments to nil reverts to the default input.

keyname sets the name of the lua script that will be used to load/save the keyconf as.
~~~~

**Table methods (invoke with :) **

name | args | returns | description
---- | ---- | ------- | -----------
new | | | Force a reconfigure of all labels
match | inputtbl | restary | Take an input table and return an array of all matching labels.
buildtbl | inputtbl, label, *state* | restbl | Build an input table based in a source table and a desired label.
reconfigure_players | Force a reconfiguure of the player- setup only.

**Table members **

symbol | kind | value
------ | ---- | -----
cooldown | num | number of ticks until a new input is accepted
keyfile | string | the keyfile in use
ignore_modifiers | boolean | should lookup etc. take shift/ctrl/alt/meta states into account.
n_players | num | the number of players set up
n_buttons | num | the number of buttons set up
n_axes | num | the number of analog axes set up

</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn Ståhl</dc:creator><pubDate>Fri, 26 Oct 2012 03:44:11 -0000</pubDate><guid>https://sourceforge.net8ee337fba2d4e72368a7677b568988641de72a9c</guid></item></channel></rss>