DEV Community

Cover image for No One Has This Problem? Just Me? OK.
Viorel PETCU
Viorel PETCU

Posted on

No One Has This Problem? Just Me? OK.

I think I just solved a problem nobody else cared to fix.

I’ve been using a Mac for years and got used to everything just working the way I like it. But at work, I have to use Windows. Add to that the fact that I live in Germany, so the provided hardware has a QWERTZ layout plus all the umlauts: Ä, Ö, Ü, and the Sharp S or ß. Add to that the fact that I have to write a lot in Romanian, with its own set of diacritics: Ă, Â, Î, Ș, Ț, and you can imagine how messy keyboard shortcuts and special characters can get.

After 12 years of doing this balancing act, as a software developer and technical writer, I finally found a setup that fixes it all. It’s the perfect mix of AutoHotkey and the Logitech MX Keys Mini (German layout), Mac, and PC special keys.

Logitech MX Keys Mini is the best.

Before we go any further, let’s settle one thing. If you don’t think the Logitech MX Keys Mini is the best keyboard out there, you’re wrong. Stop reading, go to a brick-and-mortar store that carries it (all of the technology-oriented ones will have it), and test it. After you inevitably discover this fact, come back and finish the article. I could write an entire fanboy article about this piece of exceptional hardware because it's just that good.

Logitech MX MINI keyboard

But we are here for a different reason... so let's get back to that.

QWERTZ Isn’t a Problem.

No, wait — one more detour while we’re at it. Yes, I’m using the German layout for programming. I know, I know... everyone thinks their layout is the best. Go ahead, grab your pitchforks, and tell me how I’m “doing it wrong.” But after 22 years of professional coding, I can tell you: it is all in your head! No layout is superior — you build muscle memory and become efficient regardless of character location. So the best layout is the one that makes you fastest and doesn’t give you Carpal Tunnel issues after a day of coding and writing. It just so happens that QWERTZ is more useful for both German and Romanian, and I would also argue for programming in general.

Here are the stats:

Keywords Total Keywords with Y or Z "Y" %-Y "Z" %-Z
C (32) 0 0% 0 0%
Java (≈67) byte, finally, synchronized, try, yield 5 ~7.5% 1 ~1.5%
Python (35) async, yield, finally, try 4 ~11.4% 0 0%
Go (25) type 1 4% 0 0%

OK, now for real — getting back to the topic...

macOS Got It Right

One thing macOS absolutely nailed is how Command + C and Control + C just make sense everywhere. Copy in the terminal? Works. Copy in a GUI? Works. No weird exceptions. On Windows, for the longest time, you had to remember that in the terminal it’s Ctrl + Shift + C — because we all know you don't want to execute Ctrl + C mid-command. It always felt wrong to me. I know Microsoft finally fixed this when text is already selected, but after years of fighting with it, I wanted something better — something that just works all the time and does so regardless of the OS.

Fixing Windows With AutoHotkey

This is where AutoHotkey enters the picture and solves this issue sublimely. This software is the:

VIM of Windows hotkeying.

Insane amounts of possible customization, including interacting/polling with open windows. WikiHow does a great TL;DR setup for getting up and running with AutoHotkey. But the authors also maintain the official documentation, so you can fully take advantage of this unique software and its capabilities.

All right, after all that reading, several rants, and what I think is my longest article yet, here is your reward — enjoy:

; Romanian diacritics layer on German keyboard using Right Ctrl as modifier
; AutoHotkey v2 — Explicit combo version, reliable uppercase handling

#SingleInstance Force
#Requires AutoHotkey v2.0

; --- Lowercase layer ---
>^a::SendText("â")
>^ä::SendText("ă")
>^s::SendText("ș")
>^t::SendText("ț")
>^i::SendText("î")

; --- Uppercase layer (Right Ctrl + Shift + key) ---
>^+a::SendText("Â")
>^+ä::SendText("Ă")
>^+s::SendText("Ș")
>^+t::SendText("Ț")
>^+i::SendText("Î")

; --- ALT(CMD) + C / X / V remaps to COPY / CUT / PASTE system-wide ---
!c::Send("^c")   ; Alt + C → Ctrl + C
!x::Send("^x")   ; Alt + X → Ctrl + X
!v::Send("^v")   ; Alt + V → Ctrl + V
!r::Send("^r")   ; Alt + R → Ctrl + r
!z::Send("^z")   ; Alt + R → Ctrl + z
!+z::Send("^y")   ; Alt + SHIFT + R → Ctrl + y

; --- ALT(CMD) + A / S remaps to SELECT ALL / SAVE system-wide ---
!a::Send("^a")      ; Alt + A → Ctrl + A  (Select All)
!s::Send("^s")      ; Alt + S → Ctrl + S  (Save)
>^q::SendText("@")  ; Right CTRL + q (produce @ )
>^+::SendText("~")  ; Right CTRL + "+" (produce ~ )
>^-::Return         ; Right CTRL + - (do nothing / RETURN)
>^<::SendText("|")  ; Right CTRL + "<" (produce | ) 
>^e::SendText("€")  ; 
>^2::SendText("²")  ; 
>^3::SendText("³")  ; 

; --- CODING NEEDS
>^7::SendText("{")  ; 
>^8::SendText("[")  ; 
>^9::SendText("]")  ; 
>^0::SendText("}")  ; 
>^ß::SendText("\")  ; 
Enter fullscreen mode Exit fullscreen mode

Really customizing the MX Keys Mini

Now, if you also happen to be a total NERD and perfectionist, you can really take this all the way up to ELEVEN.

Here's how I customized the crap out of the MX Keys Mini keycaps too. The stock German layout doesn’t show any Romanian letters, obviously, so I added the missing diacritics right onto the keys. It’s a small detail, but it makes the keyboard feel bespoke!

For that, I used a permanent marker that you can find on Amazon (oil- and water-proof and able to adhere to plastic) and a simple template:

TRACE GUIDE
oil and water proof permanent white marker writes on plastic ruler template for lettering

Final result

Logitech MX MINI keyboard upgraded with diacritics

So, if you made it all the way here, I am impressed. I really thought this was a niche thing, but apparently, you are also in need of a solution for typing Romanian while using a German layout and also switching between Mac and PC on a daily basis for years. I think this makes you officially my:

BROTHER (or sister) FROM ANOTHER MOTHER

gumball and darwin best friends and brother from another mother

PEACE!

Top comments (1)

Collapse
 
darius_mihut profile image
Darius Mihut

Hey Veo,

very interesting article and very cool mod that you did to your keyboard!