Show HN: US-BR, a fork of US-intl for brazilian / portuguese programmers

12 points by Kaze404 ↗ HN
Hi.

I've been using the US-intl keyboard layout for a while, as ABTN2 (the standard Brazilian Portuguese) layout treats ' and " as dead keys, which makes programming incredibly annoying for me.

However, US-intl makes accented letters like ã, à and â annoying to type, requiring holding Alt as you press the respective keys.

As a solution, I decided to make a small fork of US-intl that changes ~, ` and ^ to dead keys, while leaving ' and " as non-dead keys (as you can easily type á with Alt+a).

It's nothing major or substantial, but I thought I'd share it in case some other brazilian / portuguese-speaking programmer might need it.

You can find it here: https://github.com/SkyLeite/us-br

7 comments

[ 4.1 ms ] story [ 25.7 ms ] thread
I'm a non-native Portuguese speaker and type in Portuguese a minority of the time, but probably at least a little bit on most days.

I've become very accustomed to using a Compose key, which doesn't have to be held down but acts as part of a sequence. For example, to type "informação" I would press

i n f o r m a Compose , c Compose ~ a o

where the ~ also involves pressing Shift.

This feels reasonably normal and natural to me, but maybe if I were typing in Portuguese more than I do, it would feel tedious. Have you tried using a Compose key? How do you think it compares with your system or with the system you were using before that?

I think ~, `, and ^ as dead keys could be a problem for people working a lot on a Unix command line, as they all have relatively common meanings to the shell (although the ` is deprecated and many people don't have a strong habit of using the ^). I guess it also depends a bit on what kinds of software environments you're working in and with, since different environments and interfaces have very different punctuation with special meanings.

I own an ErgoDox, so fortunately modifier keys aren’t a big deal to me. That said, a compose key sounds like something that would make using traditional keyboards more comfortable, especially as someone who uses (more like abuses) the <Leader> functionality in Vim.

As for shell usage, it hasn’t been an issue for me besides a slight annoyance when referring to my home directory with ~. You also just made me look up what the ^ symbol is used for in bash and I’m glad I did, as it’s something I’ve wished for before multiple times. Thank you!

I don't have a Compose key, and I really wish I did. I tried mapping my left Alt key to act as a Compose key, but I couldn't get it to work on Linux. As a workaround, I mapped a keycombo to pull up a rofi [1] menu with a list of common Unicode characters, and upon selection of a character it gets sent to my system clipboard, from where I can just paste it. In that regard, it's more like Character Map than like an actual Compose key, but it does work quite well for my needs.

When I'm on Windows, mapping a key to Compose is actually much easier to do, through the excellent WinCompose utility [2].

[1] https://github.com/davatorium/rofi

[2] http://wincompose.info/

The official OS location for setting this was moved, at least in GNOME, from "Keyboard" to "Tweaks" (package "gnome-tweaks"). If you try installing that, you might be able to get the official Compose functionality!
I just have alternate layouts depending on what I'm doing.

English, programming, and some bits of Portuguese = US keyboard + compose key

Portuguese = US-intl (but in mine, all the keys you mentioned are dead keys. No Alt need)

Similar to what I do. On the Mac, I use ABC input source for English and programming (same as US as far as I can tell, but I don't get the US flag on the menubar when it's selected), and Brazilian for PT (essentially US with dead keys, same as US-intl in Linux).

I have a keyboard shortcut to switch.

I’m using the Mac US layout. If I need to type informação:

Informa altgr c altgr n ao