Keyboards: Difference between revisions

From Achintya Rao’s Wiki
No edit summary
Other keyboard software: Update information on keyd
 
(4 intermediate revisions by the same user not shown)
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 ==
Line 20: Line 23:
[https://github.com/kmonad/kmonad <code>KMonad</code>] allows you to customise all kinds of keyboards, including the built-in ones on laptops. You can create layers, remap keys and more.
[https://github.com/kmonad/kmonad <code>KMonad</code>] 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 <code>chmox +x</code> on it and moved it to <code>/usr/local/bin</code>.
Since there are no packages for [[Ubuntu]], I grabbed the pre-compiled binary, ran <code>chmox +x</code> on it and moved it to <code>/usr/local/bin</code>.
I need to set up the configuration and start-up files before it can work.
I need to set up the configuration and start-up files before it can work. Alternatives include [https://github.com/jtroo/kanata <code>kanata</code>] and [https://github.com/rvaiya/keyd <code>keyd</code>]. If installing <code>keyd</code> using <code>sudo apt install keyd</code>, note that the package is called <code>keyd.rvaiya</code> in Debian/Ubuntu repositories.<ref>https://github.com/rvaiya/keyd/issues/1118#issuecomment-3315041065</ref>
 
=== 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 <code>disable</code> with <code>enable</code> 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.


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 <code>xinput disable "AT Translated Set 2 keyboard"</code> in the terminal and it will stop using the internal one. I can then run <code>xinput enable "AT Translated Set 2 keyboard"</code> 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.
==References==
<references />

Latest revision as of 19:47, 15 October 2025

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. Alternatives include kanata and keyd. If installing keyd using sudo apt install keyd, note that the package is called keyd.rvaiya in Debian/Ubuntu repositories.[1]

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.

References