<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Emacs on Illusion and Trifle</title><link>https://victorhge.github.io/tags/emacs/</link><description>Recent content in Emacs on Illusion and Trifle</description><generator>Hugo -- 0.156.0</generator><language>en</language><copyright>Source code here, licensed under GPLv3 ·</copyright><lastBuildDate>Mon, 02 Mar 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://victorhge.github.io/tags/emacs/index.xml" rel="self" type="application/rss+xml"/><item><title>Splitting Ctrl+Space</title><link>https://victorhge.github.io/posts/ctrl_space/</link><pubDate>Mon, 02 Mar 2026 00:00:00 +0800</pubDate><guid>https://victorhge.github.io/posts/ctrl_space/</guid><description>&lt;p&gt;Emacs comes with numerous default keybindings, which inevitably conflict with
system-level shortcuts. For Emacs beginners, resolving these conflicts can be a
significant challenge.&lt;/p&gt;
&lt;p&gt;One of the most common conflicts is with the command &lt;code&gt;set-mark-command&lt;/code&gt;, which
default binding is &lt;code&gt;C-SPC~(Ctrl+Space)&lt;/code&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. On Windows, &lt;code&gt;Ctrl+Space&lt;/code&gt; is
often used to toggle between English and Chinese input methods, which can make&lt;code&gt;Ctrl+Space&lt;/code&gt; unusable for marking in Emacs.&lt;/p&gt;
&lt;p&gt;To resolve this issue, you can either use the alternative binding for&lt;code&gt;set-mark-command&lt;/code&gt;, &lt;code&gt;C-@&lt;/code&gt;, or disable the &lt;code&gt;Ctrl+Space&lt;/code&gt; functionality in
Windows. Additionally, since the spacebar can
be operated easily with either thumb, there is a &amp;ldquo;third option&amp;rdquo;: you can
configure the &lt;code&gt;Ctrl+Space&lt;/code&gt; so that one side &lt;code&gt;Ctrl+Space&lt;/code&gt; is reserved for
Windows, while the other side &lt;code&gt;Ctrl+Space&lt;/code&gt; is available for Emacs or other
applications. This is the solution I adopted because it allows me to
maintain my habit of using both thumbs for operation.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Emacs comes with numerous default keybindings, which inevitably conflict with
system-level shortcuts.  For Emacs beginners, resolving these conflicts can be a
significant challenge.</p>
<p>One of the most common conflicts is with the command <code>set-mark-command</code>, which
default binding is <code>C-SPC~(Ctrl+Space)</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.  On Windows, <code>Ctrl+Space</code> is
often used to toggle between English and Chinese input methods, which can make<code>Ctrl+Space</code> unusable for marking in Emacs.</p>
<p>To resolve this issue, you can either use the alternative binding for<code>set-mark-command</code>, <code>C-@</code>, or disable the <code>Ctrl+Space</code> functionality in
Windows.  Additionally, since the spacebar can
be operated easily with either thumb, there is a &ldquo;third option&rdquo;: you can
configure the <code>Ctrl+Space</code> so that one side <code>Ctrl+Space</code> is reserved for
Windows, while the other side <code>Ctrl+Space</code> is available for Emacs or other
applications.  This is the solution I adopted because it allows me to
maintain my habit of using both thumbs for operation.</p>
<p>In the latest version of Windows 11, you can achieve this as follows:</p>
<ol>
<li>
<p>Go to <code>Settings &gt; Time &amp; Language &gt; Language &amp; region &gt; Options &gt; Microsoft Pinyin &gt; Keys</code>, and uncheck the <code>Ctrl + Space</code> box while leaving <code>Shift</code>
checked.<img loading="lazy" src="/ox-hugo/disable_Ctrl+Space.png"></p>
</li>
<li>
<p>Open PowerToys (install it if you don&rsquo;t already have it). In the <code>Keyboard Manager</code> section, add a key remapping: map <code>Ctrl(Left) + Space</code> to <code>Shift</code> or<code>Win(Left) + Space</code>.<img loading="lazy" src="/ox-hugo/remap_shortcuts.png"></p>
</li>
</ol>
<p>For older versions of Windows, where there&rsquo;s a UI bug preventing such
changes <sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>, you can solve this by manually editing the registry:</p>
<ol>
<li>Navigate to <code>HKEY_CURRENT_USER\Control Panel\Input Method\Hot Keys\00000010</code>. Modify the value of <code>Key Modifiers</code> to <code>02 80 00 00</code>, or <code>02 40 00 00</code> <sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>.</li>
<li>If you want to apply this change for all new users, make the same
modification under <code>HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000010</code>.</li>
</ol>
<p>After making these changes, restart your computer to take effect.</p>
<p>It seems that only <code>Ctrl+Space</code> can be “split,” as other key combinations are
naturally easier to reach with one hand. For example, <code>Ctrl+a</code> inherently implies<code>Right Ctrl+a</code>.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Emacs uses unique convention for keybinngs, where <code>C-SPC</code> is shorthand for<code>Ctrl+Space</code>.  This article adopts the common convention for now.&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://superuser.com/questions/327479/ctrl-space-always-toggles-chinese-ime-windows-7">https://superuser.com/questions/327479/ctrl-space-always-toggles-chinese-ime-windows-7</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>02 indicates Ctrl, 80 indicates the left side, and 40 indicates the right side.<a href="https://learn.microsoft.com/en-us/windows/win32/tsf/tf-mod--constants">https://learn.microsoft.com/en-us/windows/win32/tsf/tf-mod--constants</a>&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item><item><title>Swapping Ctrl and Alt Keys</title><link>https://victorhge.github.io/posts/swap_ctrl_alt/</link><pubDate>Wed, 25 Feb 2026 20:59:00 +0800</pubDate><guid>https://victorhge.github.io/posts/swap_ctrl_alt/</guid><description>&lt;figure&gt;
&lt;img loading="lazy" src="https://victorhge.github.io/ox-hugo/lisp-machine-keyboard-2.jpg"/&gt;
&lt;/figure&gt;
&lt;p&gt;This is an essential configuration for all the computers I use, all because of
Emacs.&lt;/p&gt;
&lt;p&gt;Emacs was originally developed as a set of macros for the TECO editor (&lt;a href="https://blog.djmnet.org/2008/08/05/origin-of-emacs/"&gt;Editing
MACroS&lt;/a&gt;). At that time, the keyboard layout used by the developers placed the
Ctrl key next to the spacebar&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, making it convenient for operation with
the thumbs. For some reason, standard keyboards that became widespread with
personal computers moved the Ctrl key to the outermost position, which forces
usage with the pinky finger. This design easily fatigues the pinky.&lt;/p&gt;</description><content:encoded><![CDATA[<figure>
    <img loading="lazy" src="/ox-hugo/lisp-machine-keyboard-2.jpg"/> 
</figure>

<p>This is an essential configuration for all the computers I use, all because of
Emacs.</p>
<p>Emacs was originally developed as a set of macros for the TECO editor (<a href="https://blog.djmnet.org/2008/08/05/origin-of-emacs/">Editing
MACroS</a>). At that time, the keyboard layout used by the developers placed the
Ctrl key next to the spacebar<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, making it convenient for operation with
the thumbs. For some reason, standard keyboards that became widespread with
personal computers moved the Ctrl key to the outermost position, which forces
usage with the pinky finger. This design easily fatigues the pinky.</p>
<p>Therefore, I choose to swap the Ctrl and Alt keys, returning the Ctrl key
to a thumb-operable position, alleviating pinky strain and significantly
improving efficiency.</p>
<p>Here’s how I do it:</p>
<ul>
<li>Windows: Using <a href="https://github.com/randyrants/sharpkeys">SharpKeys</a> for key remapping.</li>
<li>Linux (GNOME desktop): GNOME Tweak Tool makes this easy to configure<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>.</li>
</ul>
<p>This is a &ldquo;once-you-use-it-you-can&rsquo;t-go-back&rdquo; configuration.  It also has a&lsquo;hidden feature&rsquo; - driving others crazy when they try to use my keyboard.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p>Knight Keyboard <a href="http://xahlee.info/kbd/knight_keyboard.html">http://xahlee.info/kbd/knight_keyboard.html</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p>GNOME Treak Tool <a href="https://askubuntu.com/questions/885045/how-to-swap-ctrl-and-alt-keys-in-ubuntu-16-04/885047">https://askubuntu.com/questions/885045/how-to-swap-ctrl-and-alt-keys-in-ubuntu-16-04/885047</a>&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></content:encoded></item></channel></rss>