snipt

Ctrl+h for KB shortcuts

Bash

osx > enable key repeat

$ defaults write -g ApplePressAndHoldEnabled -bool false
https://snipt.net/embed/b274d20d2183f2ac3e5a6da72975a17a/
https://snipt.net/raw/b274d20d2183f2ac3e5a6da72975a17a/
b274d20d2183f2ac3e5a6da72975a17a
bash
Bash
1
2016-09-22T21:20:05
True
False
False
Oct 04, 2013 at 03:56 PM
/api/public/snipt/85661/
osx-enable-key-repeat
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nv">$ </span>defaults write -g ApplePressAndHoldEnabled -bool <span class="nb">false</span> </span></pre></div> </td></tr></table>
keyboard, osx

ActionScript 3

Simulate Keyboard Event

1
2
3
4
var keyCode:uint = Keyboard.UP;
var e:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 0, keyCode );

someEventDispatcher.dispatchEvent( e ); 
https://snipt.net/embed/43db126c94727f4eb8cc33657cda03f6/
https://snipt.net/raw/43db126c94727f4eb8cc33657cda03f6/
43db126c94727f4eb8cc33657cda03f6
as3
ActionScript 3
5
2016-09-21T21:52:00
True
False
False
/api/public/snipt/33553/
simulate-keyboard-event
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="kd">var</span> <span class="n">keyCode</span><span class="p">:</span><span class="kt">uint</span> <span class="o">=</span> <span class="n">Keyboard</span><span class="o">.</span><span class="na">UP</span><span class="o">;</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">var</span> <span class="n">e</span><span class="p">:</span><span class="kt">KeyboardEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="kt">KeyboardEvent</span><span class="o">(</span> <span class="n">KeyboardEvent</span><span class="o">.</span><span class="na">KEY_DOWN</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="n">keyCode</span> <span class="o">);</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="n">someEventDispatcher</span><span class="o">.</span><span class="na">dispatchEvent</span><span class="o">(</span> <span class="n">e</span> <span class="o">);</span> </span></pre></div> </td></tr></table>
as3, keyboard, utility

Text only

shortcut to increase and decrease digit in VIM

Ctrl-x: Decrease digit at cursor in VIM 
Ctrl-a: Increase digit at cursor in VIM
https://snipt.net/embed/3d19d95c67e41b6b8b358df205612ee9/
https://snipt.net/raw/3d19d95c67e41b6b8b358df205612ee9/
3d19d95c67e41b6b8b358df205612ee9
text
Text only
2
2016-09-21T09:56:01
True
False
False
/api/public/snipt/28731/
shortcut-to-increase-and-decrease-digit-in-vim
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>Ctrl-x: Decrease digit at cursor in VIM </span><span id="L-2"><a name="L-2"></a>Ctrl-a: Increase digit at cursor in VIM </span></pre></div> </td></tr></table>
keyboard, shortcut

ActionScript 3

Detect keypress in ActionScript

1
2
3
4
5
6
Stage.addEventListener(keyboard.KEY_DOWN, handleKeypress);

function handleKeypress(e:keyboardEvent):void
{
	trace(event.keyCode);
}
https://snipt.net/embed/17efc3464e25284ce3e51d42aab17cdb/
https://snipt.net/raw/17efc3464e25284ce3e51d42aab17cdb/
17efc3464e25284ce3e51d42aab17cdb
as3
ActionScript 3
6
2016-09-24T16:29:03
True
False
False
/api/public/snipt/18436/
detect-keypress-in-actionscript
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="n">Stage</span><span class="o">.</span><span class="na">addEventListener</span><span class="o">(</span><span class="n">keyboard</span><span class="o">.</span><span class="na">KEY_DOWN</span><span class="o">,</span> <span class="n">handleKeypress</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="kd">function </span><span class="nf">handleKeypress</span><span class="o">(</span><span class="n">e</span><span class="o">:</span><span class="kt">keyboardEvent</span><span class="o">):</span><span class="kt">void</span> </span><span id="L-4"><a name="L-4"></a><span class="o">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nf">trace</span><span class="o">(</span><span class="n">event</span><span class="o">.</span><span class="na">keyCode</span><span class="o">);</span> </span><span id="L-6"><a name="L-6"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
actionscript, events, keyboard, keycode, keypress

Bash

to change the caps_lock key under X edit the Xmodmap

1
2
3
4
! No Caps Lock
clear lock
! Caps Lock as mod4
add mod4 = Caps_Lock
https://snipt.net/embed/a98db07ff8ec1cb284b0670c2b47f9ed/
https://snipt.net/raw/a98db07ff8ec1cb284b0670c2b47f9ed/
a98db07ff8ec1cb284b0670c2b47f9ed
bash
Bash
4
2016-09-24T07:36:03
True
False
False
/api/public/snipt/9031/
to-change-the-caps_lock-key-under-x-edit-the-xmodmap
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>! No Caps Lock </span><span id="L-2"><a name="L-2"></a>clear lock </span><span id="L-3"><a name="L-3"></a>! Caps Lock as mod4 </span><span id="L-4"><a name="L-4"></a>add <span class="nv">mod4</span> <span class="o">=</span> Caps_Lock </span></pre></div> </td></tr></table>
caps-lock, keyboard, x, xmodmap
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.