# Keyboard layouts - Scandinavian

**URL:** <https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990>\
**Category:** Offtopic\
**Created:** [June 27, 2018, 7:10am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990 "2018-06-27T07:10:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [June 27, 2018, 7:10am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/1 "2018-06-27T07:10:50Z")

</div>

I would like to hear opinions on keyboard layouts for programming.  
I was brought up in the UK so was used to the UK keyboard layout, but worked at CERN in Switzerland where there was a very odd Swiss layout as I remember (I had a Falco terminal which switched between VT220 emulation and Tektronix. Think about that the next time you complain about Julia Plots in the REPL)

When I went to ASML in the Netherlands the whole company had decided to standardise on the US keyboard layout. Which was a Good Thing TM in my opinion.  
When I bought a new laptop I made sure it had a US layout.

I am now working in Denmark and the Scandinavian layout drives me spare. I still cannot find the carat symbol (its there on a keycap above Ø … but …)  
So a point for discussion. Programming languages, such as Julia, have a heavy reliance on symbols such as - \> |  
What are the opinions on keyboard layout for productivity?  
Interested to hear from Julians who do not use the Roman alphabet in their mother languages also.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 27, 2018, 7:14am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/2 "2018-06-27T07:14:05Z")

</div>

> [@johnh](#):
>
> I still cannot find the carat symbol (its there on a keycap above Ø … but …)

On a Swedish keyboard you do Shift + (key right of Å), I think it is the same on Danish.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [June 27, 2018, 7:17am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/3 "2018-06-27T07:17:24Z")

</div>

Kristoffer, tak. That is really weird - I have to press Shift TWICE then the ^ symbol appears.  
I have never met a keyboard which does that!

(Tak - one of my few Danish words. I hang my head in shame).

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [June 27, 2018, 7:23am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/4 "2018-06-27T07:23:09Z")

</div>

Where in Denmark? Happy to meet up and show you how our weird keyboards work 😉

edit: for the new Pkg3 you’ll also want to know that ] is AltGr + 9

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [June 27, 2018, 7:31am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/5 "2018-06-27T07:31:42Z")

</div>

@pkofod I am in Bagsvaerd. Not at Novo Nordisk but next door at Novozymes. A bit of a Python shop really…  
I knew a Per Kofod from SGI Are you related?

Also I know that Julia is being used by a company nearby for digital signal processing.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 27, 2018, 7:34am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/6 "2018-06-27T07:34:16Z")

</div>

> [@johnh](#):
>
> I have to press Shift TWICE then the ^ symbol appears.

> <https://superuser.com/questions/890624/why-i-have-to-press-keys-two-times-to-get-the-or-%c2%b4-or-symbol-in-windows-7-an>

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 27, 2018, 7:43am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/7 "2018-06-27T07:43:13Z")

</div>

My native language is Hungarian, which has a lot of accents, but I find anything but the US layout suboptimal for programming. My compromise is the `alt-intl` layout in Xorg, I enable and disable it with `CapsLock` and `Shift-CapsLock`, and use `'a` to type `á`, etc, whenever I have to type accented chars. The relevant snippet for `xorg.conf.d` is below.

```nohighlight
Section "InputClass"
    Identifier "keyboard-all"
    Driver "evdev"
    Option "XkbLayout" "us,us"
    Option "XkbVariant" ",alt-intl"
    Option "XkbOptions" "compose:prsc,grp:shift_caps_switch,altwin:hyper_win,terminat$
    MatchIsKeyboard "on"
EndSection

```

Also, it pays to learn some level of touch typing. This usually happens automatically. Using a single or a small number of keyboards (eg your laptop, office keyboard, possibly a home keyboard) also helps. Set everything to the same layout and ignore the labels on the keys.

---

<div class="post-metadata">

**Author:** ![NiclasMattsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niclasmattsson/32/21988_2.png) [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Post date:** [June 27, 2018, 11:43am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/8 "2018-06-27T11:43:24Z")

</div>

I am also on a Swedish keyboard and can attest to the fact that it is extremely painful to do any kind of programming with. The main problem is that you need the AltGr key (immediately right of Space) to access all the following characters: `[] { } ~ \ | $ @`. And the keys you need to hit with AltGr are awkwardly situated in the top row under the number keys (or way to the left for `|`). [Here’s an image of the layout](http://kbdlayout.info/KBDSW/) we have to deal with.

But after many years of pain I finally have a solution I’m happy with. When programming, I switch to a custom keyboard layout which gives easy access to the keys you normally need AltGr with (all other keys are in the standard positions in the Swedish layout) and hide the default Swedish keys under AltGr instead. When typing in Swedish I switch back to the standard layout.

If anyone is interested, these are the keys I remap:

```julia
ö => [ä =>] Ö => { Ä => }
å => \ Å => | ¨ => ~ (not quotation but the diaeresis modifier key)
§ => @ ½ => $ (these are permanent remaps because § and ½ are completely useless)

```

Custom layouts can be created using [Microsoft’s tool](https://www.microsoft.com/en-us/download/details.aspx?id=22339), and Windows lets you define keyboard shortcuts to quickly switch between layouts without touching the mouse. However, since I always have [AutoHotKey](https://autohotkey.com/) running in the background for other reasons, I just do the remapping in an AHK script instead.

Believe me when I say it’s totally worth the hour or two of setup time you need to fix this problem once and for all.

---

<div class="post-metadata">

**Author:** ![anriseth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anriseth/32/3106_2.png) [@anriseth](https://discourse.julialang.org/u/anriseth)\
**Post date:** [June 27, 2018, 11:54am UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/9 "2018-06-27T11:54:33Z")

</div>

Are you using Windows or Linux (or OS X…)?

I use the standard XKB Norwegian Dvorak layout with two alterations to get the tilde, circumflex, and dollar signs in “easy-to-access” positions. This works really well, but I dread the day that I start working in a place that won’t let me use Dvorak; my productivity will take a serious hit 😛

In the unlikely case that anybody is interested, my two changes to the XKB symbols file `no` is

```julia
key <AE04> { [4, dollar, currency, onequarter] };
key <AD12> { [dead_diaeresis, dead_circumflex, dead_tilde, dead_caron] };

```

It can also be achieved with `.Xmodmap`:

```julia
keycode 35 = asciitilde asciicircum dead_diaeresis dead_circumflex asciitilde dead_caron dead_tilde
keycode 13 = 4 dollar onequarter

```

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [June 27, 2018, 12:06pm UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/10 "2018-06-27T12:06:42Z")

</div>

I am using Ubuntu Linux. The place where I work doesn’t care about which keyboard I use. Its just there are Danish ones lying around.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [June 27, 2018, 7:01pm UTC](https://discourse.julialang.org/t/keyboard-layouts-scandinavian/11990/11 "2018-06-27T19:01:35Z")

</div>

I live in Sweden and routinely switch back to a us layout every time I code. It’s just easier.
