awesome-ez/index.html

312 lines
7.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>awesome-ez API documentation</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>awesome-ez</h1>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>awesome-ez</strong></li>
</ul>
</div>
<div id="content">
<h1>Module <code>awesome-ez</code></h1>
<p>Create key and button bindings from simple definitions.</p>
<p></p>
<h3>Info:</h3>
<ul>
<li><strong>Copyright</strong>: 2019 James Reed</li>
<li><strong>Author</strong>: James Reed &lt;jcrd@tuta.io&gt; et al.</li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#ez.util.cb_from_table">ez.util.cb_from_table (cb)</a></td>
<td class="summary">Convert a table into a callable function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.util.parse_key">ez.util.parse_key (keydef)</a></td>
<td class="summary">Parse a key definition string into modifiers and a key.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.util.parse_button">ez.util.parse_button (btndef)</a></td>
<td class="summary">Parse a button definition string into modifiers and a button.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.key">ez.key (keydef, cb)</a></td>
<td class="summary">Create a key binding from a key definition string and callback.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.btn">ez.btn (btndef, cb)</a></td>
<td class="summary">Create a button binding from a button definition string and callback.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.keytable">ez.keytable (tbl)</a></td>
<td class="summary">Create key bindings for elements of a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ez.btntable">ez.btntable (tbl)</a></td>
<td class="summary">Create button bindings for elements of a table.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "ez.util.cb_from_table"></a>
<strong>ez.util.cb_from_table (cb)</strong>
</dt>
<dd>
Convert a table into a callable function.
<p> The first element of the table should be a function, followed by arguments
to this function.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">cb</span>
The callback or a table describing the callback.
</li>
</ul>
<h3>Returns:</h3>
<ol>
The callback.
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> cb = ez.util.cb_from_table({awful.spawn, <span class="string">"xterm"</span>})</pre>
</ul>
</dd>
<dt>
<a name = "ez.util.parse_key"></a>
<strong>ez.util.parse_key (keydef)</strong>
</dt>
<dd>
Parse a key definition string into modifiers and a key.
<p> Key definition strings consist of modifier characters and a key separated
by hyphens, e.g. "M-S-x" is the combination of Mod4, Shift, and the x key.
If the key is surrounded by <>, it is interpreted as a key group, e.g.
"M-&ltnumrow&gt uses the modifier Mod4 and the key group "numrow".
<p> The modifier key strings are: M = Mod4, A = Mod1, S = Shift, C = Control.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">keydef</span>
The key definition string.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table of modifiers and the key.
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> modkeys, key = ez.util.parse_key(<span class="string">"M-Return"</span>)</pre>
</ul>
</dd>
<dt>
<a name = "ez.util.parse_button"></a>
<strong>ez.util.parse_button (btndef)</strong>
</dt>
<dd>
Parse a button definition string into modifiers and a button.
<p> Button definition strings consist of modifier characters and a key separated
by hyphens, e.g. "M-S-1" is the combination of Mod4, Shift, and button 1.
<p> The modifier key strings are: M = Mod4, A = Mod1, S = Shift, C = Control.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">btndef</span>
The button definition string.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table of modifiers and the button.
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">local</span> modkeys, btn = ez.util.parse_button(<span class="string">"M-1"</span>)</pre>
</ul>
</dd>
<dt>
<a name = "ez.key"></a>
<strong>ez.key (keydef, cb)</strong>
</dt>
<dd>
Create a key binding from a key definition string and callback.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">keydef</span>
The key definition string.
</li>
<li><span class="parameter">cb</span>
The callback or table describing the callback.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table with the key objects.
</ol>
</dd>
<dt>
<a name = "ez.btn"></a>
<strong>ez.btn (btndef, cb)</strong>
</dt>
<dd>
Create a button binding from a button definition string and callback.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">btndef</span>
The button definition string.
</li>
<li><span class="parameter">cb</span>
The callback or table describing the callback.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table with the button objects.
</ol>
</dd>
<dt>
<a name = "ez.keytable"></a>
<strong>ez.keytable (tbl)</strong>
</dt>
<dd>
Create key bindings for elements of a table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
The table of key bindings.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table containing created key objects.
</ol>
</dd>
<dt>
<a name = "ez.btntable"></a>
<strong>ez.btntable (tbl)</strong>
</dt>
<dd>
Create button bindings for elements of a table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">tbl</span>
The table of button bindings.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A table containing created button objects.
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-08-15 14:31:05 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>