<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mntnoe.com &#187; danish characters</title>
	<atom:link href="http://mntnoe.com/tag/danish-characters/feed/" rel="self" type="application/rss+xml" />
	<link>http://mntnoe.com</link>
	<description></description>
	<lastBuildDate>Sat, 24 Mar 2012 20:14:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>English keyboard layout with Danish characters</title>
		<link>http://mntnoe.com/2008/06/english-keyboard-layout-with-danish-characters/</link>
		<comments>http://mntnoe.com/2008/06/english-keyboard-layout-with-danish-characters/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:30:12 +0000</pubDate>
		<dc:creator>Mads Navntoft Noe</dc:creator>
				<category><![CDATA[Key Bindings]]></category>
		<category><![CDATA[danish characters]]></category>
		<category><![CDATA[xmodmap]]></category>

		<guid isPermaLink="false">http://www.mntnoe.com/?p=12</guid>
		<description><![CDATA[I have a Danish keyboard, but I find the English keyboard layout better to code with, so some time ago, I made some customizations using xmodmap to combine these. I wanted to use the English layout in general, but with the Danish characters Ã¦, Ã¸, and Ã¥ available using Alt Gr-;, Alt Gr-&#8217; and Alt [...]]]></description>
			<content:encoded><![CDATA[<p>I have a Danish keyboard, but I find the English keyboard layout better to code with, so some time ago, I made some customizations using <em>xmodmap</em> to combine these. I wanted to use the English layout in general, but with the Danish characters <em>Ã¦</em>, <em>Ã¸</em>, and <em>Ã¥</em> available using <em>Alt Gr-;</em>, <em>Alt Gr-&#8217;</em> and <em>Alt Gr-[</em>, respectively. Also, I wanted to be able to use <em>Alt Gr</em> as a modifier for <em>FVWM</em> shortcuts.</p>
<p>This turned out to be tricky to accomplish, actually. If I set <em>XkbLayout=us</em> in <em>xorg.conf</em> (English layout), I couldn't get <em>Alt Gr</em> to work with the Danish Characters and as a modifier key at the same time. <em>Mode_Switch</em> or <em>ISO_Level3_Shift</em> either switched keycodes or acted as a modifier key, but not both. Even if I restored the previous Danish layout using dumps of keycodes and modifiers from <em>xmodmap</em>, it didn't work.</p>
<p>So I made a hack: <span id="more-12"></span>Using <em>XkbLayout=dk</em> (Danish layout in <em>xorg.conf</em>), I overrided every keycode using <em>xmodmap</em>, see my <a href="http://www.mntnoe.com/wp-content/uploads/2008/06/xmodmap">.Xmodmap</a>. This setup is unportable however, so follow these steps instead. I think it should work for other European layouts as well.</p>
<p>With <em>XkbLayout=us</em>, dump the keycodes:</p>
<pre>xmodmap -pke &gt; ~/Xmodmap-us</pre>
<p>Switch back to the Danish layout and dump again:</p>
<pre>xmodmap -pke &gt; ~/.Xmodmap</pre>
<p>Now hand edit <em>.Xmodmap</em>, replacing the keys that are different in <em>Xmodmap-us</em> ($%^&amp;[]/ etc.), but ignore the modifier keys. The two layouts uses different modifier keys (<em>Alt_R</em> vs <em>Alt Gr</em> for instance), and I could only make it work with the Danish ones. By the way, <a href="http://www.vim.org/htmldoc/diff.html" target="_blank">vimdiff</a> is your friend&#8230;</p>
<p>The Danish characters are handled like below. The last two arguments in each line are the one used when pressing <em>Alt Gr</em> (<em>ISO_Level3_Shift</em>). The 3rd and 4th argument are for <em>Mode_Switch</em> and not used here.</p>
<pre>keycode  34 = bracketleft braceleft aring Aring aring Aring
keycode  47 = semicolon colon ae AE ae AE
keycode  48 = apostrophe quotedbl oslash Oslash oslash Oslash</pre>
<p>Also, I have mapped the <em>onehalf</em> key (to the left of <em>1</em>) to <em>backtick</em> (<em>`</em>) and the <em>apostrofe</em> key (to the right of <em>Ã¸</em>) to <em>tilde</em> (<em>~</em>). Tweak it to match your preferences.</p>
<p>To use your new layout, the following must be run every time you log in (some distros do this automagically).</p>
<pre>xmodmap ~/.Xmodmap
</pre>
<p>Now the Danish characters are available when you (rarely?) need them, and <em>Alt Gr</em> is still available as a modifier (<em>Mod5</em>).</p>
<p>&#8212;&#8212;&#8212;<br />
Note: The <em>add Lock</em>/<em>remove Lock</em> stuff in <a href="http://www.mntnoe.com/wp-content/uploads/2008/06/xmodmap">.Xmodmap</a> is necessary if you want to remap <em>Caps Lock</em>. I have remapped it to the <em>Scroll Lock</em> key, and then both the <em>Escape</em> key and <em>Caps Lock</em> key acting as <em>Escape</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mntnoe.com/2008/06/english-keyboard-layout-with-danish-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

