Keyboard long-press for special characters

I recently installed Fedora 42 with KDE Plasma, and I’m looking for an on-screen keyboard that allows me to click individual keys with my mouse.

In Windows, this feature is called “On-Screen Keyboard,” and in macOS, it can be accessed by clicking “Show Keyboard Viewer” under the keyboard icon in the taskbar.

I found a bug report that describes the problem: 466948 – A way to show the virtual keyboard manually, without necessarily using a touch device

My use case involves a child who needs to type French accented letters on a US keyboard, which does not have those characters. Clicking on the letters with a mouse is much easier than trying to train them to use AltGr deadkeys.

With that said, I am posting in brainstorming to propose an alternative solution to the above problem. In Mac OS, if you hold down a key long enough, a popup appears giving you the option of choosing non-ASCII alternatives:

On Mac, can be toggled on or off using the commanddefaults write -g ApplePressAndHoldEnabled -bool true (or false)

Would something like this be feasible in KDE?

2 Likes

We actually tried to implement this several years ago.

The problem was that the surrounding infrastructure wasn’t set up for it, so it didn’t really work properly. To do it right, we need infrastructural changes in how input methods can be chained together and one can delegate tasks to another one. Then this can be implemented as just another input method.

There is ongoing work in this area, fortunately!

1 Like

In Linux world, we use AltGr and Compose keys.

Not as fancy as Windows® and MacOS® but powerful.

You can also use different∕multiple keyboard(s) layout ; some offers a lot of glyphs like Bépo (not only french but all european language using extended latin alphabet).

While not as annoying as having to remember unicode character codes, you still have to remember the glyphs to stick a different type of hat over a letter. Having the basics built in to a long press function would be ideal for the general public, à la MacOS while power users will obviously be more experienced with unicode IDs and AltGr key sequences.

1 Like

This is interesting - on my phone, long press hits the ‘Shift’ layer - which is useful, but not so much on a keyboard.

With your example, I’m interested if you can change those options - as the fact is personally I never type those characters myself - but if I did, there is Compose (and you can add new options with .XCompose). I set my Compose key to RAlt, but as I now have RAlt as AltGr, I mapped it to my CapsLock… either way, it’s very easy now to hit compose: Let’s look a alternatives for ‘o’:
RAlt/o ø
RAlt~o õ
RAltoe œ
RAlt-o ō

Even typing that is a case in point, I press RAlt for compose, then < to ‘open’ a key, > to end, kn to go to the next ( </kbd><kbd>).

Auto-Repeat is mostly useful for navigation (especially vertical) deleting/backspacing… so it would be nice to have fine tuning to allow that for specified keys only… but now life is getting complicated; and we do have .XCompose.

Custom Keymaps are a great way to get around issues too - putting ° ‘degree’ as the third level character for my ‘o’ and/or put extra currencies - I have € on E, but then £ and ฿ is on 4 with $.

Anyway, in the absence of a long-press option, take a good look at ~/.XCompose and figure out how to best use Compose. To enable me to use CapsLock for XCompose, I set both my Shift keys to lock instead (single Shift unlocks) - much like a mechanical typewriter.

1 Like

This feature has been added: Plasma Keyboard: FLOSS/Fund, diacritics, and more | Merritt Codes

4 Likes

Wow!

Amazing. Thanks.

1 Like

This is so great… not having to figure out how to do $, ฿, €, £ every time just pulling up a list with $ amongst other things.

1 Like

Sorry for the late reply; I was hesitant to install this. I expected it to be included in Fedora 44 or for there to be a stable release between your post and now. Since that isn’t the case, I followed the blog’s instructions and ran:

flatpak install --user --or-update https://cdn.kde.org/flatpak/plasma-keyboard-nightly/org.kde.plasma.keyboard.flatpakref

I then enabled the Plasma Keyboard via System Settings → Keyboard → Virtual Keyboard.

Note: I also had to click the icon in the system tray to activate it (it can be disabled the same way).

It works!

Questions:

  • I’ve only been using this for about 15 minutes; how do I undo these changes if I want to return to the stable version?

  • Once enabled, the key repeat function stops working. Is it impossible to have both character accents and key repeats active at the same time?

Thanks again.

The diacritics feature isn’t in Fedora 44 because it will be part of Plasma 6.7, which is due to be released 2026-06-16. Fedora will likely have it as an update not long after that.

flatpak remove org.kde.plasma.keyboard

At the moment this isn’t possible. There has been some discussion about it and I have a couple things I’d like to try regarding it when I have some time, so we’ll see. :slight_smile:

1 Like