Assertfail

Using multiple keyboard layouts on Windows 10

24 Nov 2019

Why

C style programming languages are designed in the cultural context of having a English keyboard layout. Programming C style languages on a Swedish keyboard layout is somewhat awkward since you need to exercise finger gymnastics in order to use common characters like {}\. Unless you switch to Python the easiest fix is to use multiple keyboard layouts.

How

I started out by adding English (US) and then Swedish (Sweden) however, I ended up with a long list of keyboard layouts in the keyboard selection that comes up when you press WIN+space. Among those where layouts I couldn’t figure out how they ended up there. A coworker helped me out by telling me that what I wanted is to use the English (UK) language but with US keyboard, since otherwise you will end up with additional UK keyboard layouts.

What I wanted was this configuration preferred languages

but for the UK language you add the US keyboard layout that you prefer: language options

In my case it was the standard US keyboard layout:

expected output

UTF-8 issues in git-bash

A somewhat related issue is that you can have issues around locale in git bash. Following the instructions on stackoverflow should suffice.

Ok, so now Windows has updated and I’ve got three keyboard layouts

extra keyboard in menu

Note the extra keyboard layout and locale, could be for instance “English (United Kingdom)”, and add that locale and keyboard in the Language parts of settings.

Add the extra keyboard so that you end up with the extra keyboard:

temporary english UK and US keyboards

Then go ahead and delete that keyboard while making sure that your currently selected keyboard is not that one.

Tags


Comments

Do you want to send a comment or give me a hint about any issues with a blog post: Open up an issue on GitHub.

Do you want to fix an error or add a comment published on the blog? You can do a fork of this post and do a pull request on github.