diff options
author | Teddy Wing | 2018-11-15 06:43:59 +0100 |
---|---|---|
committer | Teddy Wing | 2018-11-15 06:43:59 +0100 |
commit | e747622d84b2200b5316afa8bff1620cc575089d (patch) | |
tree | 1cb52b9bf71f7c92790a054f62d94d820cb70b21 | |
parent | 82f5b83490116f6ae860754f6562273e3cc1767e (diff) | |
download | dome-key-web-e747622d84b2200b5316afa8bff1620cc575089d.tar.bz2 |
Add manual pages
Also a section linking to them on the home page.
Generated in the main DomeKey repository with:
$ a2x --no-xmllint --format xhtml doc/dome-key.1.intermediate.txt
$ a2x --no-xmllint --format xhtml doc/dome-key-mappings.7.txt
Deciding to go with the AsciiDoc CSS for now and not bother with making
these pages fit with the site's style to make things easy.
-rw-r--r-- | doc/docbook-xsl.css | 329 | ||||
-rw-r--r-- | doc/dome-key-mappings.7.html | 183 | ||||
-rw-r--r-- | doc/dome-key.1.html | 106 | ||||
-rw-r--r-- | index.html | 6 |
4 files changed, 624 insertions, 0 deletions
diff --git a/doc/docbook-xsl.css b/doc/docbook-xsl.css new file mode 100644 index 0000000..ee9ca46 --- /dev/null +++ b/doc/docbook-xsl.css @@ -0,0 +1,329 @@ +/* + CSS stylesheet for XHTML produced by DocBook XSL stylesheets. +*/ + +body { + font-family: Georgia,serif; +} + +code, pre { + font-family: "Courier New", Courier, monospace; +} + +span.strong { + font-weight: bold; +} + +body blockquote { + margin-top: .75em; + line-height: 1.5; + margin-bottom: .75em; +} + +html body { + margin: 1em 5% 1em 5%; + line-height: 1.2; +} + +body div { + margin: 0; +} + +h1, h2, h3, h4, h5, h6 +{ + color: #527bbd; + font-family: Arial,Helvetica,sans-serif; +} + +div.toc p:first-child, +div.list-of-figures p:first-child, +div.list-of-tables p:first-child, +div.list-of-examples p:first-child, +div.example p.title, +div.sidebar p.title +{ + font-weight: bold; + color: #527bbd; + font-family: Arial,Helvetica,sans-serif; + margin-bottom: 0.2em; +} + +body h1 { + margin: .0em 0 0 -4%; + line-height: 1.3; + border-bottom: 2px solid silver; +} + +body h2 { + margin: 0.5em 0 0 -4%; + line-height: 1.3; + border-bottom: 2px solid silver; +} + +body h3 { + margin: .8em 0 0 -3%; + line-height: 1.3; +} + +body h4 { + margin: .8em 0 0 -3%; + line-height: 1.3; +} + +body h5 { + margin: .8em 0 0 -2%; + line-height: 1.3; +} + +body h6 { + margin: .8em 0 0 -1%; + line-height: 1.3; +} + +body hr { + border: none; /* Broken on IE6 */ +} +div.footnotes hr { + border: 1px solid silver; +} + +div.navheader th, div.navheader td, div.navfooter td { + font-family: Arial,Helvetica,sans-serif; + font-size: 0.9em; + font-weight: bold; + color: #527bbd; +} +div.navheader img, div.navfooter img { + border-style: none; +} +div.navheader a, div.navfooter a { + font-weight: normal; +} +div.navfooter hr { + border: 1px solid silver; +} + +body td { + line-height: 1.2 +} + +body th { + line-height: 1.2; +} + +ol { + line-height: 1.2; +} + +ul, body dir, body menu { + line-height: 1.2; +} + +html { + margin: 0; + padding: 0; +} + +body h1, body h2, body h3, body h4, body h5, body h6 { + margin-left: 0 +} + +body pre { + margin: 0.5em 10% 0.5em 1em; + line-height: 1.0; + color: navy; +} + +tt.literal, code.literal { + color: navy; +} + +.programlisting, .screen { + border: 1px solid silver; + background: #f4f4f4; + margin: 0.5em 10% 0.5em 0; + padding: 0.5em 1em; +} + +div.sidebar { + background: #ffffee; + margin: 1.0em 10% 0.5em 0; + padding: 0.5em 1em; + border: 1px solid silver; +} +div.sidebar * { padding: 0; } +div.sidebar div { margin: 0; } +div.sidebar p.title { + margin-top: 0.5em; + margin-bottom: 0.2em; +} + +div.bibliomixed { + margin: 0.5em 5% 0.5em 1em; +} + +div.glossary dt { + font-weight: bold; +} +div.glossary dd p { + margin-top: 0.2em; +} + +dl { + margin: .8em 0; + line-height: 1.2; +} + +dt { + margin-top: 0.5em; +} + +dt span.term { + font-style: normal; + color: navy; +} + +div.variablelist dd p { + margin-top: 0; +} + +div.itemizedlist li, div.orderedlist li { + margin-left: -0.8em; + margin-top: 0.5em; +} + +ul, ol { + list-style-position: outside; +} + +div.sidebar ul, div.sidebar ol { + margin-left: 2.8em; +} + +div.itemizedlist p.title, +div.orderedlist p.title, +div.variablelist p.title +{ + margin-bottom: -0.8em; +} + +div.revhistory table { + border-collapse: collapse; + border: none; +} +div.revhistory th { + border: none; + color: #527bbd; + font-family: Arial,Helvetica,sans-serif; +} +div.revhistory td { + border: 1px solid silver; +} + +/* Keep TOC and index lines close together. */ +div.toc dl, div.toc dt, +div.list-of-figures dl, div.list-of-figures dt, +div.list-of-tables dl, div.list-of-tables dt, +div.indexdiv dl, div.indexdiv dt +{ + line-height: normal; + margin-top: 0; + margin-bottom: 0; +} + +/* + Table styling does not work because of overriding attributes in + generated HTML. +*/ +div.table table, +div.informaltable table +{ + margin-left: 0; + margin-right: 5%; + margin-bottom: 0.8em; +} +div.informaltable table +{ + margin-top: 0.4em +} +div.table thead, +div.table tfoot, +div.table tbody, +div.informaltable thead, +div.informaltable tfoot, +div.informaltable tbody +{ + /* No effect in IE6. */ + border-top: 3px solid #527bbd; + border-bottom: 3px solid #527bbd; +} +div.table thead, div.table tfoot, +div.informaltable thead, div.informaltable tfoot +{ + font-weight: bold; +} + +div.mediaobject img { + margin-bottom: 0.8em; +} +div.figure p.title, +div.table p.title +{ + margin-top: 1em; + margin-bottom: 0.4em; +} + +div.calloutlist p +{ + margin-top: 0em; + margin-bottom: 0.4em; +} + +a img { + border-style: none; +} + +@media print { + div.navheader, div.navfooter { display: none; } +} + +span.aqua { color: aqua; } +span.black { color: black; } +span.blue { color: blue; } +span.fuchsia { color: fuchsia; } +span.gray { color: gray; } +span.green { color: green; } +span.lime { color: lime; } +span.maroon { color: maroon; } +span.navy { color: navy; } +span.olive { color: olive; } +span.purple { color: purple; } +span.red { color: red; } +span.silver { color: silver; } +span.teal { color: teal; } +span.white { color: white; } +span.yellow { color: yellow; } + +span.aqua-background { background: aqua; } +span.black-background { background: black; } +span.blue-background { background: blue; } +span.fuchsia-background { background: fuchsia; } +span.gray-background { background: gray; } +span.green-background { background: green; } +span.lime-background { background: lime; } +span.maroon-background { background: maroon; } +span.navy-background { background: navy; } +span.olive-background { background: olive; } +span.purple-background { background: purple; } +span.red-background { background: red; } +span.silver-background { background: silver; } +span.teal-background { background: teal; } +span.white-background { background: white; } +span.yellow-background { background: yellow; } + +span.big { font-size: 2em; } +span.small { font-size: 0.6em; } + +span.underline { text-decoration: underline; } +span.overline { text-decoration: overline; } +span.line-through { text-decoration: line-through; } diff --git a/doc/dome-key-mappings.7.html b/doc/dome-key-mappings.7.html new file mode 100644 index 0000000..526f348 --- /dev/null +++ b/doc/dome-key-mappings.7.html @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>dome-key-mappings(7)</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idm319643336560"></a>dome-key-mappings(7)</h2></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name">1. NAME</a></span></dt><dt><span class="section"><a href="#_synopsis">2. SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description">3. DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_syntax">4. SYNTAX</a></span></dt><dd><dl><dt><span class="section"><a href="#_map">4.1. Map</a></span></dt><dt><span class="section"><a href="#_command">4.2. Command</a></span></dt><dt><span class="section"><a href="#_mode">4.3. Mode</a></span></dt><dt><span class="section"><a href="#_special_keys">4.4. Special Keys</a></span></dt><dt><span class="section"><a href="#_modifiers">4.5. Modifiers</a></span></dt></dl></dd><dt><span class="section"><a href="#_examples_2">5. EXAMPLES</a></span></dt><dt><span class="section"><a href="#_see_also">6. SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name"></a>1. NAME</h2></div></div></div><p>dome-key-mappings - Mapping definition syntax for dome-key</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis"></a>2. SYNOPSIS</h2></div></div></div><p>Describes dome-key’s mapping syntax</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description"></a>3. DESCRIPTION</h2></div></div></div><p>The mappings file lives at <span class="emphasis"><em>~/.config/dome-key/mappings.dkmap</em></span>. All +mappings should be written there. Three types of mappings can be defined: +maps, commands, and modes.</p><p>Maps are used to simulate keyboard keys. Commands run shell commands. +Modes, when activated, enable you to define multiple actions for the same +headphone buttons.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_syntax"></a>4. SYNTAX</h2></div></div></div><p>Map and command mappings are composed of three parts, each separated by +whitespace (one or more spaces or tabs):</p><pre class="literallayout">MAP_TYPE TRIGGER ACTION</pre><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> +MAP_TYPE is the kind of action (<span class="strong"><strong>map</strong></span> or <span class="strong"><strong>cmd</strong></span>). +</li><li class="listitem"> +TRIGGER is one or more headphone keys (<span class="strong"><strong><Up></strong></span>, <span class="strong"><strong><Play></strong></span>, <span class="strong"><strong><Down></strong></span>). +</li><li class="listitem"> +ACTION defines what to do when the headphone keys from TRIGGER are + pressed. +</li></ul></div><p>Mappings must be written on a single line. No line continuation operator +is available.</p><p>Comment lines are prefixed with a ‘#’ and must appear on their own line. +They are not permitted on the same line as mapping definitions.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_map"></a>4.1. Map</h3></div></div></div><p>ACTION corresponds to a sequence of keyboard keys that will be pressed +virtually. For example,</p><pre class="literallayout">map <Up> Hello<Enter></pre><p>will type "Hello" with a newline at the end. Simulated keys are pressed in +succession as quickly as possible. There is no way to wait or sleep +between keys.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_command"></a>4.2. Command</h3></div></div></div><p>ACTION must be a shell command. In:</p><pre class="literallayout">cmd <Down> say "Good morning"</pre><p>the <span class="strong"><strong>/usr/bin/say</strong></span> command will be executed, playing "Good morning" in +audible speech.</p><p>This map type is useful for running arbitrary code that can’t be expressed +by simulating keyboard keys with a <span class="strong"><strong>map</strong></span>.</p><p>Commands are executed with <span class="strong"><strong>$SHELL -c ACTION</strong></span>. If <span class="strong"><strong>$SHELL</strong></span> isn’t set, +<span class="strong"><strong>/bin/sh</strong></span> is used instead.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_mode"></a>4.3. Mode</h3></div></div></div><p>You can think of modes like Vim modes. They enable you to map the same +trigger more than once. Let’s look at an example:</p><pre class="literallayout">cmd <Play> open -a Firefox</pre><pre class="literallayout">mode <Up> { + map <Play> <Space> +}</pre><p>Here, the <span class="strong"><strong><Play></strong></span> headphone button will open Firefox. But when the mode +is active, pressing <span class="strong"><strong><Play></strong></span> instead simulates the Space key.</p><p>Modes are both activated and deactivated by pressing the TRIGGER sequence +written after the <span class="strong"><strong>mode</strong></span> keyword. The trigger functions as a toggle. In +our example, pressing <span class="strong"><strong><Up></strong></span> activates the mode. If the mode is active, +pressing <span class="strong"><strong><Up></strong></span> will deactivate the mode, causing top-level mappings to +become available again.</p><p>Any number of maps and commands can be defined inside a mode. These are +enclosed by curly braces. Mode mappings should not use the same trigger +as the mode’s. Mappings with the same trigger are ignored:</p><pre class="literallayout">mode <Play> { + # The following mapping is ignored: + map <Play> Hello +}</pre><p>Modes cannot be nested.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_special_keys"></a>4.4. Special Keys</h3></div></div></div><p>Special keys are enclosed in ‘<’ ‘>’ brackets (e.g. <span class="strong"><strong><Play></strong></span>). These are +used in <span class="strong"><strong>map</strong></span> actions to simulate a key press.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +Nop +</span></dt><dd> + Unmaps a trigger. Used to remove the default behaviour of a trigger + button without remapping it. +</dd><dt><span class="term"> +F1 +, </span><span class="term"> +F2 +, </span><span class="term"> +F3 +, </span><span class="term"> +F4 +, </span><span class="term"> +F5 +, </span><span class="term"> +F6 +, </span><span class="term"> +F7 +, </span><span class="term"> +F8 +, </span><span class="term"> +F9 +, </span><span class="term"> +F10 +, </span><span class="term"> +F11 +, </span><span class="term"> +F12 +</span></dt><dd> + Function keys +</dd><dt><span class="term"> +Up +, </span><span class="term"> +Down +, </span><span class="term"> +Left +, </span><span class="term"> +Right +</span></dt><dd> + Arrow keys +</dd></dl></div><p>Home, End, PageUp, PageDown</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +Return +, </span><span class="term"> +Enter +, </span><span class="term"> +CR +</span></dt><dd> + Synonyms for the Return key +</dd><dt><span class="term"> +Del +</span></dt><dd> + Forward delete +</dd><dt><span class="term"> +BS +</span></dt><dd> + Backspace +</dd><dt><span class="term"> +Esc +</span></dt><dd> + Escape +</dd></dl></div><p>CapsLock, NumLock</p><p>Tab, Space</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +VolumeUp +, </span><span class="term"> +VolumeDown +, </span><span class="term"> +Mute +</span></dt><dd> + Volume keys +</dd></dl></div><p>BrightnessUp, BrightnessDown, ContrastUp, ContrastDown</p><p>Help</p><p>Power, Eject</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +VidMirror +</span></dt><dd> + Mirror displays +</dd><dt><span class="term"> +Play +, </span><span class="term"> +Next +, </span><span class="term"> +Previous +, </span><span class="term"> +Fast +, </span><span class="term"> +Rewind +</span></dt><dd> + Media keys +</dd><dt><span class="term"> +IlluminationUp +, </span><span class="term"> +IlluminationDown +, </span><span class="term"> +IlluminationToggle +</span></dt><dd> + Keyboard backlight +</dd></dl></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_escaping"></a>Escaping</h4></div></div></div><p>To simulate a literal ‘<’ character, it must be escaped with a backslash. +Because backslash is used as an escape prefix, literal backslashes must +also be escaped with a backslash.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> +‘<’ becomes ‘\<’ +</li><li class="listitem"> +‘\’ becomes ‘\\’ +</li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_modifiers"></a>4.5. Modifiers</h3></div></div></div><p>Modifiers can be applied to any key used in <span class="strong"><strong>map</strong></span> actions. Modifiers can +also be chained. Modifiers must be prefixed to the key they’re modifying, +both of which are surrounded by ‘<’ ‘>’ brackets.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +D- +</span></dt><dd> + Apple/Command key +</dd><dt><span class="term"> +A- +</span></dt><dd> + Option key +</dd><dt><span class="term"> +C- +</span></dt><dd> + Control key +</dd><dt><span class="term"> +S- +</span></dt><dd> + Shift key +</dd></dl></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_examples"></a>Examples</h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +<C-c> +</span></dt><dd> + Control-c +</dd><dt><span class="term"> +<C-S-c> +</span></dt><dd> + Control-Shift-c +</dd><dt><span class="term"> +<D-A-C-S-f> +</span></dt><dd> + Apple-Option-Control-Shift-f +</dd><dt><span class="term"> +<A-VolumeDown> +</span></dt><dd> + Option-VolumeDown +</dd><dt><span class="term"> +<D-A-Eject> +</span></dt><dd> + Apple-Option-Eject +</dd></dl></div></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_examples_2"></a>5. EXAMPLES</h2></div></div></div><p>Video controls:</p><pre class="literallayout">map <Up> <Left> +map <Play> <Space> +map <Down> <Right></pre><p>Don’t launch iTunes when pressing the middle button:</p><pre class="literallayout">map <Play> <Nop></pre><p>Let volume buttons function normally, and activate video controls when +pressing <span class="strong"><strong><Play></strong></span> twice:</p><pre class="literallayout">mode <Play><Play> { + map <Up> <Left> + map <Play> <Space> + map <Down> <Right> +}</pre><p>Open frequently used applications:</p><pre class="literallayout">cmd <Up> open -a Terminal +cmd <Play> open -a Xcode +cmd <Down> open -a Firefox +cmd <Up><Play> open -a Dictionary</pre><p>Compile code in Vim:</p><pre class="literallayout">map <Play> <Esc>:make<CR></pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also"></a>6. SEE ALSO</h2></div></div></div><p>dome-key(1).</p></div></div></body></html>
\ No newline at end of file diff --git a/doc/dome-key.1.html b/doc/dome-key.1.html new file mode 100644 index 0000000..6a3e632 --- /dev/null +++ b/doc/dome-key.1.html @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>dome-key(1)</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idm229411390320"></a>dome-key(1)</h2></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name">1. NAME</a></span></dt><dt><span class="section"><a href="#_synopsis">2. SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description">3. DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options">4. OPTIONS</a></span></dt><dt><span class="section"><a href="#_configuration">5. CONFIGURATION</a></span></dt><dt><span class="section"><a href="#_mappings">6. MAPPINGS</a></span></dt><dt><span class="section"><a href="#_launchd">7. LAUNCHD</a></span></dt><dt><span class="section"><a href="#_files">8. FILES</a></span></dt><dt><span class="section"><a href="#_see_also">9. SEE ALSO</a></span></dt><dt><span class="section"><a href="#_copyright">10. COPYRIGHT</a></span></dt><dd><dl><dt><span class="section"><a href="#_aquatic_prime">10.1. Aquatic Prime</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name"></a>1. NAME</h2></div></div></div><p>dome-key - Custom mappings for headphone buttons</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis"></a>2. SYNOPSIS</h2></div></div></div><p><span class="strong"><strong>dome-key</strong></span> [<span class="emphasis"><em>options</em></span>]</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description"></a>3. DESCRIPTION</h2></div></div></div><p>Enables customisation of headphone buttons. The <span class="strong"><strong>dome-key</strong></span> program runs +in the background listening to button events, executing user-defined +actions in response to these events.</p><p>Headphone button mappings are defined in a file called +<span class="emphasis"><em>~/.config/dome-key/mappings.dkmap</em></span>. See <span class="emphasis"><em>MAPPINGS</em></span> or +dome-key-mappings(7) for more information.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_options"></a>4. OPTIONS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +--audio +</span></dt><dd> + Play interface audio. Sounds will play to provide feedback when a mode + is activated or deactivated. +</dd><dt><span class="term"> +-d, --daemon +</span></dt><dd> + Run the daemon in the current shell to listen for headphone button + events. The program will run in the foreground. +</dd><dt><span class="term"> +-h, --help +</span></dt><dd> + Print usage help. +</dd><dt><span class="term"> +--license <span class="emphasis"><em>file</em></span> +</span></dt><dd> + Register the software using the license plist file at path <span class="emphasis"><em>file</em></span>. +</dd><dt><span class="term"> +-r, --reload-mappings +</span></dt><dd> + Reload the mappings file. If an instance of <span class="strong"><strong>dome-key</strong></span> is running, no + updates to the mappings file are taken into account automatically. + Executing the program with this flag will cause the running daemon to + reload the mappings file into its memory. This is typically easier + than killing and relaunching the daemon. +</dd><dt><span class="term"> +-v, --version +</span></dt><dd> + Print the program version. +</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_configuration"></a>5. CONFIGURATION</h2></div></div></div><p>An optional configuration file can be added at +<span class="emphasis"><em>~/.config/dome-key/config.toml</em></span>.</p><p>Presently, only one configuration option is available. Here’s an example +config:</p><pre class="literallayout">timeout = 400</pre><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +timeout +</span></dt><dd> + Sets the speed of multi-button mappings. To run an action mapped to + <span class="emphasis"><em><Play><Down></em></span>, you first press the ‘play’ button, then the ‘down’ + button on your headphones. The time allowed between each button press + is defined by this option. By default, it’s set to 500 milliseconds. + It can be changed to any positive integer amount of milliseconds. + Setting it to <span class="emphasis"><em>0</em></span> will prevent multi-button mappings and cause button + actions to be executed immediately. +</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_mappings"></a>6. MAPPINGS</h2></div></div></div><p>Mappings are defined in <span class="emphasis"><em>~/.config/dome-key/mappings.dkmap</em></span>. See +dome-key-mappings(7) for a complete explanation of the syntax.</p><p>If a button is not mapped, it retains its normal function. The following +mappings apply when undefined, even without a mappings file:</p><pre class="literallayout">map <Up> <VolumeUp> +map <Play> <Play> +map <Down> <VolumeDown></pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_launchd"></a>7. LAUNCHD</h2></div></div></div><p>It’s recommended that you run the program in the background using +launchd(8). Here’s an example plist:</p><pre class="literallayout"><?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>com.teddywing.dome-key</string> + <key>ProgramArguments</key> + <array> + <string>/usr/local/bin/dome-key</string> + <string>--daemon</string> + <string>--audio</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>KeepAlive</key> + <true/> + <key>StandardErrorPath</key> + <string>/tmp/dome-key.log</string> +</dict> +</plist></pre><p>You can also use <span class="strong"><strong>brew services</strong></span> to do this automatically if the program +was installed with Homebrew.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_files"></a>8. FILES</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> +<span class="strong"><strong>~/.config/dome-key/config.toml</strong></span> +</span></dt><dd> + Configuration file. +</dd><dt><span class="term"> +<span class="strong"><strong>~/.config/dome-key/mappings.dkmap</strong></span> +</span></dt><dd> + Button mapping definitions. +</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also"></a>9. SEE ALSO</h2></div></div></div><p>dome-key-mappings(7).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_copyright"></a>10. COPYRIGHT</h2></div></div></div><p>Copyright © 2018 Teddy Wing</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_aquatic_prime"></a>10.1. Aquatic Prime</h3></div></div></div><p>Copyright © 2005-2010 Lucas Newman and other contributors. All rights +reserved.</p><p>Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> +Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +</li><li class="listitem"> +Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +</li><li class="listitem"> +Neither the name of the Aquatic nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. +</li></ul></div><p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p></div></div></div></body></html>
\ No newline at end of file @@ -91,6 +91,12 @@ cmd <Down> open -a Firefox</pre> <pre class="code code-block margin-bottom-1.8 font-size-0.8"> cmd <Play> osascript -e 'activate application "Terminal"' -e 'tell application "System Events" to keystroke "2" using command down'</pre> + <h2>Manual</h2> + <p> + <a href="/doc/dome-key.1.html">dome-key(1)</a>, + <a href="/doc/dome-key-mappings.7.html">dome-key-mappings(7)</a> + </p> + <h2>System requirements</h2> <ul> <li> |