views:

2410

answers:

12

I think everybody who had to program using a standard German (or any other international) keyboard layout on Windows (or Mac) will complain about the conundrum of either having all special characters ( [ ] | { } / etc. ) needed for most programming languages "at the fingertip" and "losing" the language specific characters (umlauts ä ö ü etc.) on the keyboard or viceversa: having simple access to umlauts, but not to brackets etc.

If you are programming in C / C++ / C# / Java / Javascript for example, it is very exhausting if you have to press Alt-Gr + 7 for every opening curly bracket. It is an ergonomic nightmare and reduces your typing efficiency.

alt text

What is the best way to cope with this problem? Is there a satisfying solution? Maybe there are special layouts or keyboards which address this issue?

+1  A: 

I am also german and have the same problem. My solution is use english layout (where the special chars, like braces, brackets and similar are all well positioned) for programming and switch to german layout when typing doc or text (where I need my umlauts). In KDE you can define a shortcut to switch fast between them (I have Alt-Ctrl-k), you can even make it window dependend, i.e. one window (e.g. eclipse) with english and one window (e.g. emacs) with german - so you even skip the switching.

I guess for windows similar switching is possible.

flolo
As a Czech, I use this approach too. Although it is still quite annoying.
Josef Sábl
+4  A: 

One solution is the following: Use a keyboard with US layout and option for user-defined bindings. Then you can map ALT+a => ä , ALT+SHIFT+a => Ä, ..., ALT+s => ß.

mkoeller
+1 I use exactly the same Layout
danimajo
+4  A: 

Hi,

I can see your point, but I kind of got used to it.
After programming C for some years on a german keyboard AltGr + 7 etc. is just as normal as typing characters to me.
Maybe you could just use an english layout with your german keyboard for programming, which might take a little getting used to.

I everything failes you can still purchase this ;) :
http://www.artlebedev.com/everything/optimus/

Nick
I too got used to it, in my case the Swedish layout. Pretty close to the German one with alt-7 for {, but with the y and z at the same place as the English one. I hve tried the international but thought it was more trouble than it was worth.
some
Oh, the Optimus keyboard looks great. I guess you have to be a Russian Oligarch to afford such a piece (1 275.45 Euro = 1 600 US$) :-(
splattne
I guess so^^ or a pretty good programmer ;)
Nick
+1  A: 

I use the US-International keyboard layout. It is generally a normal US layout, but has some dead keys (~"'\), which requires to enter an additional space if I need one of those characters, but I am used to that. All special characters can be entered either using the dead-keys ("a -> ä, \e -> è) or using Alt-Gr (Alt-Gr + s -> ß).

I don't know if this is the best solution, but I don't like to switch between different layouts. And this way it is easy to remember how to type a language specific character.

Wimmel
A: 

I switch between standard US layout (programming, writing English text, ...), US international layout (writing text in languages with accentuated characters) and Pinyin layout (for Chinese).

In my case, US International with QWERTY is much more practical than using the standard French layout, since I can input all those uppercase accentuated characters, as well as other characters not used in French and don't have to deal with layout problems when playing games...

gko
A: 

At work I use a Dutch(Belgium) keyboard and my notebook(where I am right now typing) has a En-US keyboard. It was a little bit difficult in the beginning, but I kinda used to the Alt-Gr stuff. Thanks to eclipse, it inserts the closing curly brace every time I open one. I use the numeric keypad for numbers rather than Shift+....

It is just a matter of time. Now every time my hand feels it is working on a laptop keyboard, it knows that it is QWERTY and if it is typing on a regular keyboard, it does a mental context switch to AZERTY. I don't switch languages or anything like that.

And as a sideline, it is a pity that we have these many keyboard layouts. The height of this is that the BE-NL (Dutch-Belgium) keyboard has AZERTY layout and the NL-NL (Dutch-Netherlands) has a QWERTY layout. Come on, both are the same language, at least as for as a keyboard is concerned.

Nivas
+5  A: 

I agree, the German keyboard layout is a horror, and US International's dead keys are even more unacceptable for coders IMO. (How many ' and "s do you type a day?)

In the end I gave in and hacked up my own keyboard layout in MSKLC to cover all the Latin-based diacritics and quick access to various European „smart“ «quotes», as well as phonetics and a bunch of other weird stuff.

More info: http://www.doxdesk.com/software/win/eurokb.html

bobince
A: 

Same problem on French keyboard...
Apple solved that once with the Apple //e I owned some time ago: they had a physical switch under the keyboard to swap keyboard layouts between Azerty and Qwerty (with double engraving).
It was quite a gymnastic to type fast on both keyboard.

Now, I just use the French keyboard, I am used to play with AltGr...
Although in SciTE, I have made a macro that surround current line(s) selection with braces, at right indentation. Quite handy. I miss it in Eclipse, although at least it adds automatically the ending brace.
You can use the template generation (in Eclipse or SciTE, named abbreviations) although I rarely remember to use it...

I also use AutoHotkey (Windows only) to do some shortcuts, although more to type quickly À Ç œ or such than programming stuff...

PhiLho
+3  A: 

The great keyboard layout available in Ubuntu (and variants) is Qwerty US-International - with AltGr deadkey. (This is the 'Alt' key on the right side of the keyboard.)

It avoids problems with so many anoying dead-keys (' `) when typing regular text or code and only Alt-Gr is active compared to the regular Qwerty US keyboard. (Alt-Gr + e => é for example, Alt-Gr + `` + a => à, etc... Great for French accents.)

And same for Windows here, http://keyboards.jargon-file.org/altinter.zip Enjoy!

+1  A: 

My solution is simple: Compose key on top of an English-only layout (I use Dvorak, but US qwerty would work as well)

For those who don't know: Compose key means I designate a key or key combination as the compose key (I use shift+shift). Then, when I press one of many predefined key sequences starting with the compose key, they get transformed into some other key.

Example: (compose key) (lowercase oh) (slash) becomes "oslash", or ø. With an uppercase Oh instead, the result is Ø. Similarly, (compose key) (lowercase oh) (double quotes) becomes ö.

I can also define my own sequences in ~/.XCompose. Among my favorites are (compose key) (one) (slash) (zero) becoming ∞ (the infinity sign), (compose key) (pipe) (pipe) becoming ∨ (the mathematical "or" operator) and (compose key) (space) (a) becoming α (the greek letter alpha). This is particularly useful if you write a lot of math in LaTeX and you want more WYSIWYG-ness on the level of individual characters (which, IMNSHO, is a good thing).

Jonas Kölker
A: 

I also have a terrible German keyboard before my eyes. Still. I work with the US layout since I remember it well.

User
A: 

Canadian French, it's the best for accentued and programmation

http://en.wikipedia.org/wiki/Keyboard_layout#Canadian_French

Jonaze