Keyboards: Difference between revisions

From Achintya Rao’s Wiki
Fix explanation for xinput section
Update info on compose
Line 4: Line 4:
== Compose key ==
== Compose key ==


On my [[ThinkPad]] running [[Linux]], I have my <kbd>AltGr</kbd> key mapped to <kbd>Compose</kbd>.
On my [[ThinkPad]] running [[Kubuntu]], I have my <kbd>Right&nbsp;Ctrl</kbd> key mapped to <kbd>Compose</kbd>.
This allows me to type symbols like ¶ and § by entering the right sequence of keys (<kbd>AltGr</kbd>+<kbd>p</kbd>+<kbd>!</kbd> and <kbd>AltGr</kbd>+<kbd>s</kbd>+<kbd>o</kbd> respectively).
This allows me to type symbols like ¶ and § by entering the right sequence of keys (<kbd>Right&nbsp;Ctrl</kbd>+<kbd>p</kbd>+<kbd>!</kbd> and <kbd>Right&nbsp;Ctrl</kbd>+<kbd>s</kbd>+<kbd>o</kbd> respectively).
To get a list of all available combinations, type the following in the terminal (via [https://askubuntu.com/a/34933 Ask Ubuntu]):
To get a list of all available combinations, type the following in the terminal (via [https://askubuntu.com/a/34933 Ask Ubuntu]):


   cat /usr/share/X11/locale/en_US.UTF-8/Compose
   cat /usr/share/X11/locale/en_US.UTF-8/Compose
I have also mapped the <kbd>AltGr</kbd> key to choose third-level characters.
For this to work, I also have to enable “Enable extra typographic characters” under “Compatibility options” in the keyboard settings.


== Mechanical keyboards ==
== Mechanical keyboards ==

Revision as of 20:23, 18 November 2024

This page contains more than just information about typing. Specifically it deals with [customising] keyboards in general.

Compose key

On my ThinkPad running Kubuntu, I have my Right Ctrl key mapped to Compose. This allows me to type symbols like ¶ and § by entering the right sequence of keys (Right Ctrl+p+! and Right Ctrl+s+o respectively). To get a list of all available combinations, type the following in the terminal (via Ask Ubuntu):

 cat /usr/share/X11/locale/en_US.UTF-8/Compose

I have also mapped the AltGr key to choose third-level characters. For this to work, I also have to enable “Enable extra typographic characters” under “Compatibility options” in the keyboard settings.

Mechanical keyboards

I was gifted a Corsair K95 RGB Platinum keyboard for my birthday in 2021. While Corsair does not provide software for controlling the keyboard profiles and lights, there is a free/open-source alternative called ckb-next. Unfortunately, one cannot write the profiles to the keyboard’s hardware from Linux, so I need to do so using a different machine.

Other keyboard software

KMonad allows you to customise all kinds of keyboards, including the built-in ones on laptops. You can create layers, remap keys and more. Since there are no packages for Ubuntu, I grabbed the pre-compiled binary, ran chmox +x on it and moved it to /usr/local/bin. I need to set up the configuration and start-up files before it can work.

Disabling laptop keyboard

If I want to disable the built-in keyboard on my laptop (if I’m connected to an external keyboard, for example), I can run the following in the terminal and it will stop using the internal one:

    xinput disable "AT Translated Set 2 keyboard"

I can then replace disable with enable to reactivate it. Since I don’t yet know how to automate this so that the internal one is disabled automatically when a USB keyboard is connected, I have to remember to reactive it when I disconnect the laptop from the hub and take it with me.