532 lines
39 KiB
HTML
532 lines
39 KiB
HTML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<!-- This file is generated by Nim. -->
|
|
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>src/libs/nim/xutils/jinput</title>
|
|
|
|
<!-- Favicon -->
|
|
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
|
|
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
|
|
|
|
<!-- CSS -->
|
|
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.0.6">
|
|
|
|
<!-- JS -->
|
|
<script type="text/javascript" src="dochack.js?v=2.0.6"></script>
|
|
</head>
|
|
<body>
|
|
<div class="document" id="documentId">
|
|
<div class="container">
|
|
<h1 class="title">src/libs/nim/xutils/jinput</h1>
|
|
<div class="row">
|
|
<div class="three columns">
|
|
<div class="theme-select-wrapper">
|
|
<label for="theme-select">Theme: </label>
|
|
<select id="theme-select" onchange="setTheme(this.value)">
|
|
<option value="auto">🌗 Match OS</option>
|
|
<option value="dark">🌑 Dark</option>
|
|
<option value="light">🌕 Light</option>
|
|
</select>
|
|
</div>
|
|
<div id="global-links">
|
|
<ul class="simple">
|
|
<li><a id="indexLink" href="theindex.html">Index</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchInputDiv">
|
|
Search: <input type="search" id="searchInput" onkeyup="search()"/>
|
|
</div>
|
|
<div>
|
|
Group by:
|
|
<select onchange="groupBy(this.value)">
|
|
<option value="section">Section</option>
|
|
<option value="type">Type</option>
|
|
</select>
|
|
</div>
|
|
<ul class="simple simple-toc" id="toc-list">
|
|
<li>
|
|
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<li><a class="reference" href="#CircularBuffer" title="CircularBuffer[T] = object
|
|
buffer*: seq[T]
|
|
max* = 9
|
|
currentPos* = 0">CircularBuffer</a></li>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#8" id="58">Vars</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<li><a class="reference" href="#latestMouseClick" title="latestMouseClick = createShared(mouseEvent, 1)">latestMouseClick</a></li>
|
|
<li><a class="reference" href="#scratchCodes" title="scratchCodes: Table[cint, int]">scratchCodes</a></li>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#9" id="59">Lets</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<li><a class="reference" href="#display" title="display = XOpenDisplay(nil)">display</a></li>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<ul class="simple nested-toc-section">addToCircularBuffer
|
|
<li><a class="reference" href="#addToCircularBuffer%2CCircularBuffer%5BT%5D%2CT" title="addToCircularBuffer[T](b: var CircularBuffer[T]; a: T)">addToCircularBuffer[T](b: var CircularBuffer[T]; a: T)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">backSpace
|
|
<li><a class="reference" href="#backSpace%2CWindow%2CWindow" title="backSpace(root, window: Window)">backSpace(root, window: Window)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">commitToKbMap
|
|
<li><a class="reference" href="#commitToKbMap%2Ccint%2Ccint" title="commitToKbMap(value, commit: cint)">commitToKbMap(value, commit: cint)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">detectMouseClickImpl
|
|
<li><a class="reference" href="#detectMouseClickImpl" title="detectMouseClickImpl()">detectMouseClickImpl()</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">generateScratchCodes
|
|
<li><a class="reference" href="#generateScratchCodes%2Ccontext" title="generateScratchCodes(context: context)">generateScratchCodes(context: context)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getAndIterate
|
|
<li><a class="reference" href="#getAndIterate%2CCircularBuffer%5BT%5D" title="getAndIterate[T](a: var CircularBuffer[T]): T">getAndIterate[T](a: var CircularBuffer[T]): T</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getFromCircularBuffer
|
|
<li><a class="reference" href="#getFromCircularBuffer%2CCircularBuffer%5BT%5D%2Cint" title="getFromCircularBuffer[T](a: CircularBuffer[T]; length: int): seq[T]">getFromCircularBuffer[T](a: CircularBuffer[T]; length: int): seq[T]</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getKeyCodes
|
|
<li><a class="reference" href="#getKeyCodes" title="getKeyCodes(): Table[int, seq[keyboardKey]]">getKeyCodes(): Table[int, seq[keyboardKey]]</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getKeyCodesStr
|
|
<li><a class="reference" href="#getKeyCodesStr" title="getKeyCodesStr(): Table[int, seq[string]]">getKeyCodesStr(): Table[int, seq[string]]</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getKeys
|
|
<li><a class="reference" href="#getKeys%2CPDisplay" title="getKeys(display: PDisplay): seq[seq[culong]]">getKeys(display: PDisplay): seq[seq[culong]]</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getMousePosition
|
|
<li><a class="reference" href="#getMousePosition" title="getMousePosition(): (cint, cint)">getMousePosition(): (cint, cint)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">getWindows
|
|
<li><a class="reference" href="#getWindows%2Cptr.Window%2Cptr.Window" title="getWindows(root, window: ptr Window)">getWindows(root, window: ptr Window)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">initJinput
|
|
<li><a class="reference" href="#initJinput" title="initJinput()">initJinput()</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">initMouseEvent
|
|
<li><a class="reference" href="#initMouseEvent%2C%2C%2CclickType" title="initMouseEvent(time: times.Time; buttonPosition: (cint, cint);
|
|
pressType: clickType): mouseEvent">initMouseEvent(time: times.Time; buttonPosition: (cint, cint);
|
|
pressType: clickType): mouseEvent</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">lockKeyboard
|
|
<li><a class="reference" href="#lockKeyboard%2CPDisplay" title="lockKeyboard(display: PDisplay): string">lockKeyboard(display: PDisplay): string</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">sendKeyGeneric
|
|
<li><a class="reference" href="#sendKeyGeneric%2Ccuint" title="sendKeyGeneric(keycode: cuint)">sendKeyGeneric(keycode: cuint)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">sendToWindow
|
|
<li><a class="reference" href="#sendToWindow%2Ccuint%2CWindow%2CWindow%2CPDisplay" title="sendToWindow(keyCode: cuint; root, window: Window; display: PDisplay)">sendToWindow(keyCode: cuint; root, window: Window; display: PDisplay)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">sendToX
|
|
<li><a class="reference" href="#sendToX%2Cseq%5Bint%5D%2CWindow%2CWindow" title="sendToX(characterValue: seq[int]; root, window: Window)">sendToX(characterValue: seq[int]; root, window: Window)</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">unlockKeyboard
|
|
<li><a class="reference" href="#unlockKeyboard%2CPDisplay" title="unlockKeyboard(display: PDisplay)">unlockKeyboard(display: PDisplay)</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
<li>
|
|
<details open>
|
|
<summary><a class="reference reference-toplevel" href="#15" id="65">Iterators</a></summary>
|
|
<ul class="simple simple-toc-section">
|
|
<ul class="simple nested-toc-section">readInput
|
|
<li><a class="reference" href="#readInput.i" title="readInput(): keyEvent">readInput(): keyEvent</a></li>
|
|
|
|
</ul>
|
|
<ul class="simple nested-toc-section">readMouse
|
|
<li><a class="reference" href="#readMouse.i" title="readMouse(): mouseEvent">readMouse(): mouseEvent</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
</details>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
<div class="nine columns" id="content">
|
|
|
|
<div id="tocRoot"></div>
|
|
|
|
<p class="module-desc">This procedure is not used anymore due to XTEST working on firefox</p>
|
|
<div class="section" id="6">
|
|
<h1><a class="toc-backref" href="#6">Imports</a></h1>
|
|
<dl class="item">
|
|
<a class="reference external" href="log.html">log</a>, <a class="reference external" href="config.html">config</a>, <a class="reference external" href="globals.html">globals</a>, <a class="reference external" href="common.html">common</a>, <a class="reference external" href="keys.html">keys</a>
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="7">
|
|
<h1><a class="toc-backref" href="#7">Types</a></h1>
|
|
<dl class="item">
|
|
<div id="CircularBuffer">
|
|
<dt><pre><a href="jinput.html#CircularBuffer"><span class="Identifier">CircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">object</span>
|
|
<span class="Identifier">buffer</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span>
|
|
<span class="Identifier">max</span><span class="Operator">*</span> <span class="Other">=</span> <span class="DecNumber">9</span>
|
|
<span class="Identifier">currentPos</span><span class="Operator">*</span> <span class="Other">=</span> <span class="DecNumber">0</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="8">
|
|
<h1><a class="toc-backref" href="#8">Vars</a></h1>
|
|
<dl class="item">
|
|
<div id="latestMouseClick">
|
|
<dt><pre><a href="jinput.html#latestMouseClick"><span class="Identifier">latestMouseClick</span></a> <span class="Other">=</span> <span class="Identifier">createShared</span><span class="Other">(</span><a href="keys.html#mouseEvent"><span class="Identifier">mouseEvent</span></a><span class="Other">,</span> <span class="DecNumber">1</span><span class="Other">)</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
<div id="scratchCodes">
|
|
<dt><pre><a href="jinput.html#scratchCodes"><span class="Identifier">scratchCodes</span></a><span class="Other">:</span> <span class="Identifier">Table</span><span class="Other">[</span><span class="Identifier">cint</span><span class="Other">,</span> <span class="Identifier">int</span><span class="Other">]</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="9">
|
|
<h1><a class="toc-backref" href="#9">Lets</a></h1>
|
|
<dl class="item">
|
|
<div id="display">
|
|
<dt><pre><a href="jinput.html#display"><span class="Identifier">display</span></a> <span class="Other">=</span> <span class="Identifier">XOpenDisplay</span><span class="Other">(</span><span class="Keyword">nil</span><span class="Other">)</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="12">
|
|
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
|
<dl class="item">
|
|
<div id="addToCircularBuffer-procs-all">
|
|
<div id="addToCircularBuffer,CircularBuffer[T],T">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#addToCircularBuffer%2CCircularBuffer%5BT%5D%2CT"><span class="Identifier">addToCircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">b</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="jinput.html#CircularBuffer"><span class="Identifier">CircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">a</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="backSpace-procs-all">
|
|
<div id="backSpace,Window,Window">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#backSpace%2CWindow%2CWindow"><span class="Identifier">backSpace</span></a><span class="Other">(</span><span class="Identifier">root</span><span class="Other">,</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">Window</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="commitToKbMap-procs-all">
|
|
<div id="commitToKbMap,cint,cint">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#commitToKbMap%2Ccint%2Ccint"><span class="Identifier">commitToKbMap</span></a><span class="Other">(</span><span class="Identifier">value</span><span class="Other">,</span> <span class="Identifier">commit</span><span class="Other">:</span> <span class="Identifier">cint</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="detectMouseClickImpl-procs-all">
|
|
<div id="detectMouseClickImpl">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#detectMouseClickImpl"><span class="Identifier">detectMouseClickImpl</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">gcsafe</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Reads mouse input and stores the most recent click event to latestMouseClick. This is used in KeyboardWriter to clear the kana buffer when the cursor changes
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="generateScratchCodes-procs-all">
|
|
<div id="generateScratchCodes,context">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#generateScratchCodes%2Ccontext"><span class="Identifier">generateScratchCodes</span></a><span class="Other">(</span><span class="Identifier">context</span><span class="Other">:</span> <a href="config.html#context"><span class="Identifier">context</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">EOFError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ExecIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Resets the keymap with setxkbmap, find empty keycodes, and serializes it
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getAndIterate-procs-all">
|
|
<div id="getAndIterate,CircularBuffer[T]">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getAndIterate%2CCircularBuffer%5BT%5D"><span class="Identifier">getAndIterate</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">a</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="jinput.html#CircularBuffer"><span class="Identifier">CircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">T</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getFromCircularBuffer-procs-all">
|
|
<div id="getFromCircularBuffer,CircularBuffer[T],int">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getFromCircularBuffer%2CCircularBuffer%5BT%5D%2Cint"><span class="Identifier">getFromCircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">a</span><span class="Other">:</span> <a href="jinput.html#CircularBuffer"><span class="Identifier">CircularBuffer</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">length</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span></pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getKeyCodes-procs-all">
|
|
<div id="getKeyCodes">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getKeyCodes"><span class="Identifier">getKeyCodes</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Table</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">,</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="keys.html#keyboardKey"><span class="Identifier">keyboardKey</span></a><span class="Other">]</span><span class="Other">]</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Higher level version of getKeys, returns a table of keycode to seq<a class="reference internal" href="#keyboardKeys">keyboardKeys</a>.
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getKeyCodesStr-procs-all">
|
|
<div id="getKeyCodesStr">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getKeyCodesStr"><span class="Identifier">getKeyCodesStr</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Table</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">,</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
<p>Lower level version of [<a class="reference internal nimdoc" title="proc getKeyCodes(): Table[int, seq[keyboardKey]]" href="#getKeyCodes">getKeyCodes</a>] but higher level than [<a class="reference internal nimdoc" title="proc getKeys(display: PDisplay): seq[seq[culong]]" href="#getKeys,PDisplay">getKeys</a>]</p>
|
|
<p>Returns a raw output of XKeysymToString(x) for each keycode. Its strings so they're easier to parse in some situations</p>
|
|
<p>Work around because I don't know of a clean way to include XF86 in the types Unfiltered, specifically implemented for XF86 removal</p>
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getKeys-procs-all">
|
|
<div id="getKeys,PDisplay">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getKeys%2CPDisplay"><span class="Identifier">getKeys</span></a><span class="Other">(</span><span class="Identifier">display</span><span class="Other">:</span> <span class="Identifier">PDisplay</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">culong</span><span class="Other">]</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Get the keys from X11, using XGetKeyboardMapping. It gets all 248 of them, and returns them in an array of key values
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getMousePosition-procs-all">
|
|
<div id="getMousePosition">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getMousePosition"><span class="Identifier">getMousePosition</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Other">(</span><span class="Identifier">cint</span><span class="Other">,</span> <span class="Identifier">cint</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="getWindows-procs-all">
|
|
<div id="getWindows,ptr.Window,ptr.Window">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#getWindows%2Cptr.Window%2Cptr.Window"><span class="Identifier">getWindows</span></a><span class="Other">(</span><span class="Identifier">root</span><span class="Other">,</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Keyword">ptr</span> <span class="Identifier">Window</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="initJinput-procs-all">
|
|
<div id="initJinput">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#initJinput"><span class="Identifier">initJinput</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">JsonKindError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span>
|
|
<span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">JsonParsingError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span>
|
|
<span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">TimeEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Deserializes the keycodes into memory
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="initMouseEvent-procs-all">
|
|
<div id="initMouseEvent,,,clickType">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#initMouseEvent%2C%2C%2CclickType"><span class="Identifier">initMouseEvent</span></a><span class="Other">(</span><span class="Identifier">time</span><span class="Other">:</span> <span class="Identifier">times</span><span class="Other">.</span><span class="Identifier">Time</span><span class="Other">;</span> <span class="Identifier">buttonPosition</span><span class="Other">:</span> <span class="Other">(</span><span class="Identifier">cint</span><span class="Other">,</span> <span class="Identifier">cint</span><span class="Other">)</span><span class="Other">;</span>
|
|
<span class="Identifier">pressType</span><span class="Other">:</span> <a href="keys.html#clickType"><span class="Identifier">clickType</span></a><span class="Other">)</span><span class="Other">:</span> <a href="keys.html#mouseEvent"><span class="Identifier">mouseEvent</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="lockKeyboard-procs-all">
|
|
<div id="lockKeyboard,PDisplay">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#lockKeyboard%2CPDisplay"><span class="Identifier">lockKeyboard</span></a><span class="Other">(</span><span class="Identifier">display</span><span class="Other">:</span> <span class="Identifier">PDisplay</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="sendKeyGeneric-procs-all">
|
|
<div id="sendKeyGeneric,cuint">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#sendKeyGeneric%2Ccuint"><span class="Identifier">sendKeyGeneric</span></a><span class="Other">(</span><span class="Identifier">keycode</span><span class="Other">:</span> <span class="Identifier">cuint</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="sendToWindow-procs-all">
|
|
<div id="sendToWindow,cuint,Window,Window,PDisplay">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#sendToWindow%2Ccuint%2CWindow%2CWindow%2CPDisplay"><span class="Identifier">sendToWindow</span></a><span class="Other">(</span><span class="Identifier">keyCode</span><span class="Other">:</span> <span class="Identifier">cuint</span><span class="Other">;</span> <span class="Identifier">root</span><span class="Other">,</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">Window</span><span class="Other">;</span> <span class="Identifier">display</span><span class="Other">:</span> <span class="Identifier">PDisplay</span><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="sendToX-procs-all">
|
|
<div id="sendToX,seq[int],Window,Window">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#sendToX%2Cseq%5Bint%5D%2CWindow%2CWindow"><span class="Identifier">sendToX</span></a><span class="Other">(</span><span class="Identifier">characterValue</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">root</span><span class="Other">,</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">Window</span><span class="Other">)</span> {.
|
|
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">TimeEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="unlockKeyboard-procs-all">
|
|
<div id="unlockKeyboard,PDisplay">
|
|
<dt><pre><span class="Keyword">proc</span> <a href="#unlockKeyboard%2CPDisplay"><span class="Identifier">unlockKeyboard</span></a><span class="Other">(</span><span class="Identifier">display</span><span class="Other">:</span> <span class="Identifier">PDisplay</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
<div class="section" id="15">
|
|
<h1><a class="toc-backref" href="#15">Iterators</a></h1>
|
|
<dl class="item">
|
|
<div id="readInput-iterators-all">
|
|
<div id="readInput.i">
|
|
<dt><pre><span class="Keyword">iterator</span> <a href="#readInput.i"><span class="Identifier">readInput</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="keys.html#keyEvent"><span class="Identifier">keyEvent</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Reads keyboard keyinputs from /dev/input
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
<div id="readMouse-iterators-all">
|
|
<div id="readMouse.i">
|
|
<dt><pre><span class="Keyword">iterator</span> <a href="#readMouse.i"><span class="Identifier">readMouse</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="keys.html#mouseEvent"><span class="Identifier">mouseEvent</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
|
|
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
|
|
<dd>
|
|
|
|
Reads mouse input from /dev/input
|
|
|
|
</dd>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="twelve-columns footer">
|
|
<span class="nim-sprite"></span>
|
|
<br>
|
|
<small style="color: var(--hint);">Made with Nim. Generated: 2024-07-08 02:24:49 UTC</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Google fonts -->
|
|
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
|
|
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
|
|
</body>
|
|
</html>
|