Custom Keyboard Backspace Bug

Summary:

My custom keyboard has very strange behaviour with the backspace key, as can be seen in the GIF below.

More Context:

I have created a custom keyboard for my computer using Keyman Developer. I am running Ubuntu 24.04 and Keyman Developer is Running in Wine. I finished off the project by editing the .kmn and .kpc files in VSCodium as Keyman Developer in WIne is very buggy, and I needed some fancier rules that the graphical editor didn’t support anyway. I was then able to build everything using the kmc command line tool, which does have Linux support. I also successfully added it to Keyman Desktop for Linux and it shows up fine in my Ubuntu desktop dropdown list of software keyboards. After a few iterations, I got everything working just as, except the backspace key has very strange behaviour (see GIF below). I just want every touch of the backspace key to delete the previous character, like it does in most standard keyboards. Please help.

Thanks!

Capture vidéo du 2025-04-28 12-01-31

Welcome, @JCode!

That is indeed strange behavior. What version of Keyman and kmc are you using? In what apps do you see this behavior?

Also, could you share the source of your custom keyboard? Then I can could take a look.

Thanks for the answer and the welcome Eberhard!

My version info is as follows:
kmc: 17.0.335
Keyman for Linux: 17.0.335
Keyman Developer: Not sure and don’t know how to check, but I downloaded it within two weeks ago so I assume 19.0.18, based on the version history on the Keyman website.

I have tried to upload a .zip file of my source documents as a part of this reply, but this was not allowed by the website as I am a new user. I will try to modify the original post with this info.

It is useful to note also that I tried just creating a blank new keyman project in Keyman Developer, building it with kmc and adding that to Keyman for Windows. This yielded the same result in terms of backspace button behaviour. This indicates to me (though I may be wrong) that the source is not the issue.

@EberhardBeilharz Sorry, I was not able to add an attachment to the main post either. Here is the raw .kmn source code:

c francais__alberta_ generated from template at 2025-04-20 00:31:51
c with name “Français (Alberta)”
store(&VERSION) ‘10.0’
store(&NAME) ‘Clavier Franco-Albertain’
store(&COPYRIGHT) ‘Copyright ©’
store(&KEYBOARDVERSION) ‘1.0’
store(&TARGETS) ‘windows macosx linux desktop’
store(&BITMAP) ‘francais__alberta_.ico’
store(&VISUALKEYBOARD) ‘francais__alberta_.kvks’

begin Unicode > use(main)

group(main) using keys

  • [SHIFT CTRL ALT K_BKSLASH] > ‘|’
  • [SHIFT CTRL ALT K_RBRKT] > ‘}’
  • [SHIFT CTRL ALT K_LBRKT] > ‘{’
  • [SHIFT CTRL ALT K_QUOTE] > ‘"’
  • [SHIFT CTRL ALT K_COLON] > ‘:’
  • [SHIFT CTRL ALT K_SLASH] > ‘?’
  • [SHIFT CTRL ALT K_PERIOD] > ‘>’
  • [SHIFT CTRL ALT K_COMMA] > ‘<’
  • [CTRL ALT K_BKQUOTE] > ‘È’
  • [CTRL ALT K_HYPHEN] > ‘-’
  • [CTRL ALT K_EQUAL] > ‘=’
  • [CTRL ALT K_BKSLASH] > ''
  • [CTRL ALT K_RBRKT] > ‘]’
  • [CTRL ALT K_LBRKT] > ‘[’
  • [CTRL ALT K_COLON] > ‘;’
  • [CTRL ALT K_QUOTE] > U+0027
  • [CTRL ALT K_SLASH] > ‘/’
  • [CTRL ALT K_PERIOD] > ‘»’
  • [CTRL ALT K_COMMA] > ‘«’
  • [CTRL ALT K_Q] > ‘"’
  • [CTRL ALT K_W] > ‘₩’
  • [CTRL ALT K_E] > ‘€’
  • [CTRL ALT K_R] > ‘®’
  • [CTRL ALT K_T] > ‘:trade_mark:
  • [CTRL ALT K_Y] > ‘¥’
  • [SHIFT ALT K_EQUAL] > ‘±’
  • [SHIFT ALT K_HYPHEN] > ‘_’
  • [SHIFT ALT K_0] > ‘)’
  • [SHIFT ALT K_9] > ‘(’
  • [SHIFT ALT K_8] > ‘*’
  • [SHIFT ALT K_7] > ‘&’
  • [SHIFT ALT K_6] > ‘^’
  • [SHIFT ALT K_5] > ‘%’
  • [SHIFT ALT K_4] > ‘$’
  • [SHIFT ALT K_3] > ‘#’
  • [SHIFT ALT K_2] > ‘@’
  • [SHIFT ALT K_1] > ‘!’
  • [SHIFT ALT K_BKQUOTE] > ‘~’
  • [SHIFT ALT K_M] > ‘M’
  • [SHIFT ALT K_N] > ‘N’
  • [SHIFT ALT K_B] > ‘B’
  • [SHIFT ALT K_V] > ‘V’
  • [SHIFT ALT K_C] > ‘C’
  • [SHIFT ALT K_X] > ‘X’
  • [SHIFT ALT K_Z] > ‘Z’
  • [SHIFT ALT K_L] > ‘L’
  • [SHIFT ALT K_K] > ‘K’
  • [SHIFT ALT K_J] > ‘J’
  • [SHIFT ALT K_H] > ‘H’
  • [SHIFT ALT K_G] > ‘G’
  • [SHIFT ALT K_F] > ‘F’
  • [SHIFT ALT K_D] > ‘D’
  • [SHIFT ALT K_S] > ‘S’
  • [SHIFT ALT K_A] > ‘A’
  • [SHIFT ALT K_P] > ‘P’
  • [SHIFT ALT K_O] > ‘O’
  • [SHIFT ALT K_I] > ‘I’
  • [SHIFT ALT K_U] > ‘U’
  • [SHIFT ALT K_BKSLASH] > ''
  • [SHIFT ALT K_RBRKT] > ‘]’
  • [SHIFT ALT K_LBRKT] > ‘[’
  • [SHIFT ALT K_QUOTE] > ‘}’
  • [SHIFT ALT K_COLON] > ‘{’
  • [SHIFT ALT K_SLASH] > ‘÷’
  • [SHIFT ALT K_PERIOD] > ‘≥’
  • [SHIFT ALT K_COMMA] > ‘≤’
  • [K_QUOTE] > ‘è’
  • [SHIFT K_SLASH] > ‘É’
  • [SHIFT K_PERIOD] > ‘.’
  • [SHIFT K_COMMA] > ‘;’
  • [SHIFT K_M] > ‘M’
  • [SHIFT K_N] > ‘N’
  • [SHIFT K_B] > ‘B’
  • [SHIFT K_V] > ‘V’
  • [SHIFT K_C] > ‘C’
  • [SHIFT K_X] > ‘X’
  • [SHIFT K_Z] > ‘Z’
  • [SHIFT K_QUOTE] > ‘~’
  • [SHIFT K_COLON] > ‘:’
  • [SHIFT K_L] > ‘L’
  • [SHIFT K_K] > ‘K’
  • [SHIFT K_J] > ‘J’
  • [SHIFT K_H] > ‘H’
  • [SHIFT K_G] > ‘G’
  • [SHIFT K_F] > ‘F’
  • [SHIFT K_D] > ‘D’
  • [SHIFT K_S] > ‘S’
  • [SHIFT K_A] > ‘A’
  • [SHIFT K_BKSLASH] > ‘À’
  • [SHIFT K_RBRKT] > ‘Ç’
  • [SHIFT K_LBRKT] > dk(grave)
  • [SHIFT K_P] > ‘P’
  • [SHIFT K_O] > ‘O’
  • [SHIFT K_I] > ‘I’
  • [SHIFT K_U] > ‘U’
  • [SHIFT K_Y] > ‘Y’
  • [SHIFT K_T] > ‘T’
  • [SHIFT K_R] > ‘R’
  • [SHIFT K_E] > ‘E’
  • [SHIFT K_W] > ‘W’
  • [SHIFT K_Q] > ‘Q’
  • [SHIFT K_EQUAL] > ‘+’
  • [SHIFT K_HYPHEN] > ‘_’
  • [SHIFT K_0] > ‘)’
  • [SHIFT K_9] > ‘(’
  • [SHIFT K_8] > ‘*’
  • [SHIFT K_7] > ‘&’
  • [SHIFT K_6] > ‘?’
  • [SHIFT K_5] > ‘%’
  • [SHIFT K_4] > ‘$’
  • [SHIFT K_3] > ‘#’
  • [SHIFT K_2] > ‘@’
  • [SHIFT K_1] > ‘!’
  • [SHIFT K_BKQUOTE] > ‘~’
  • [K_Z] > ‘z’
  • [K_X] > ‘x’
  • [K_C] > ‘c’
  • [K_V] > ‘v’
  • [K_B] > ‘b’
  • [K_N] > ‘n’
  • [K_M] > ‘m’
  • [K_COMMA] > ‘,’
  • [K_PERIOD] > ‘.’
  • [K_SLASH] > ‘é’
  • [K_COLON] > U+0027
  • [K_L] > ‘l’
  • [K_K] > ‘k’
  • [K_J] > ‘j’
  • [K_H] > ‘h’
  • [K_G] > ‘g’
  • [K_F] > ‘f’
  • [K_D] > ‘d’
  • [K_S] > ‘s’
  • [K_A] > ‘a’
  • [K_Q] > ‘q’
  • [K_W] > ‘w’
  • [K_E] > ‘e’
  • [K_R] > ‘r’
  • [K_T] > ‘t’
  • [K_Y] > ‘y’
  • [K_U] > ‘u’
  • [K_I] > ‘i’
  • [K_O] > ‘o’
  • [K_P] > ‘p’
  • [K_LBRKT] > dk(circ)
  • [K_RBRKT] > ‘ç’
  • [K_BKSLASH] > ‘à’
  • [K_EQUAL] > ‘=’
  • [K_HYPHEN] > ‘-’
  • [K_0] > ‘0’
  • [K_9] > ‘9’
  • [K_8] > ‘8’
  • [K_7] > ‘7’
  • [K_6] > ‘6’
  • [K_5] > ‘5’
  • [K_4] > ‘4’
  • [K_3] > ‘3’
  • [K_2] > ‘2’
  • [K_1] > ‘1’
  • [K_BKQUOTE] > ‘°’
    c match > use(deadkeys)
  • ' > dk(grave) dk(grave) + 'e' > 'è' dk(grave) + 'a' > 'à' dk(grave) + 'u' > 'ù' dk(grave) + 'i' > 'ì' dk(grave) + 'o' > 'ò' dk(grave) + 'E' > 'È' dk(grave) + 'A' > 'À' dk(grave) + 'Ù' > 'Ù' dk(grave) + 'I' > 'Ì' dk(grave) + 'O' > 'Ò' dk(grave) + ' ' > '
  • ‘^’ > dk(circ)
    dk(circ) + ‘e’ > ‘ê’
    dk(circ) + ‘a’ > ‘â’
    dk(circ) + ‘u’ > ‘û’
    dk(circ) + ‘i’ > ‘î’
    dk(circ) + ‘o’ > ‘ô’
    dk(circ) + ‘E’ > ‘Ê’
    dk(circ) + ‘A’ > ‘Â’
    dk(circ) + ‘U’ > ‘Û’
    dk(circ) + ‘I’ > ‘Î’
    dk(circ) + ‘O’ > ‘Ô’
    dk(circ) + ’ ’ > ‘^’
  • ‘:’ > dk(trema)
    ‘:’ + ‘e’ > U+00EB
    ‘:’ + ‘a’ > U+00E4
    ‘:’ + ‘u’ > U+00FC
    ‘:’ + ‘i’ > U+00EF
    ‘:’ + ‘o’ > U+00F6
    ‘:’ + ‘E’ > U+00CB
    ‘:’ + ‘A’ > U+00C4
    ‘:’ + ‘U’ > U+00DC
    ‘:’ + ‘I’ > U+00CF
    ‘:’ + ‘O’ > U+00D6

Can you recompile your keyboard with the latest released version, 18.0.235?

If it still doesn’t work, please zip up your keyboard project folder (the directory that contains the .kpj file) and share it through Dropbox or wetransfer.com or something like that. Pasting the .kmn source file changed too many things, and after putting it in a state so that it compiles it works for me as expected, which means the file I reconstructed is probably different from yours…

You said you also tried it with an empty project on Windows and it didn’t work there either. Could you please send us a diagnostic report on Windows (Open Keyman Configuration, go to the Support tab and then click on the Diagnostics link. This will collect some system information that you then can send to us).

Thanks for looking at my file, Eberhard. This is truly appreciated.

First, I have decided to make my project publicly available for anyone who is interested, so it can be found at the link at the bottom of the message.

Second, I have updated kmc to version 18.0.235 as recommended. I removed my keyboard from Keyman Desktop, deleted the source folder, built with kmc and re-added the resulting build to Keyman Desktop. The issue persists.

Since I cannot provide links in the response here and don’t know of another way to get you to the git repo, I have pasted the link below and added as much white space as needed within it for the comment to be acceptable.

https : // codeberg . org / JCode / Clavier_Franco-Albertain . git

I realised after sending the last reply that I neglected to answer you on the topic of the Windows diagnostic report. I am running Linux (Ubuntu 24) so this precise info is not doable. Is there a Linux equivalent that could be helpful?

I wonder if it would help if you change your targets to include web.

I wasn’t able to test your keyboard on Firefox until I selected web. (I’m on Windows 11 though.). When I selected that and tested in Firefox the backspace seems to work for me.

I suspect that the problem is not the keyboard itself, but something on your Linux system. Would this post be relevant? Does the backspacing bug show up in multiple applications? What program were you using when you created the demonstration of the bug?

Hi Lorna, thanks for the suggestion. Changing the line to exactly what you suggested caused an error on build for me (not sure why, “Invalid token found”). Instead, I simply tacked web on at the end, making

store(&TARGETS) ‘windows macosx linux desktop web’

Build worked after that but the issue persists. I am confused.

Thanks anyway!

Thanks for the input, Drowe. The bug shows up in most applications if not all. I have tested it on many. The application I was using in the submitted GIF is just the browser on this very webpage. I see the similarity with the issue you linked in your response, but I think the cause for my issue is likely different. My belief is based on the fact that I have another Keyman keyboard working fine on my computer, no backspace bug. This other keyboard was downloaded from the keyman website, not made by me. So, it seems like the issue must be in my code or in the build process. Since all of you seem to avoid issues, I am leaning towards the issue being with the kmc build. Thoughts?

Thanks again!

In your GIF you have “For example,” with backspaces deleting every other character, leaving “o xml,”.

Putting your source files into Keyman Developer and using the Debugger, I can type “For example,” and it appears as


After typing Backspace 11 times, the Debugging log looks like

And typing Backspace again, deletes the last remaining character and clears out the Keystroke log. Thus it seems that there’s nothing in the design of your keyboard that would account for the backspacing issue. It seems to me that there’s some interaction between the Linux Keyman engine and whatever your Linux system keyboard software is. @EberhardBeilharz, do you have suggestions for things to check for Keyman on Linux?

Unfortunately, the apostrophe (U+0027) characters were converted to left and right single quotation marks (U+2018 and U+2019) when the text was pasted into this forum.

I’ve updated your user account, so I think you should be able to attach the .kmp files now.

Hello all,

I had a theory that the issue must be in the kmc build. To test, I punted my source over to a Windows machine to compile using natively-running Keyman Developer. I brought the resulting build into my Linux machine and installed it with Keyman Desktop (Linux). It presents the same issue. I am now perplexed because my Linux machine runs other Keyman keyboards without issue, just not anything that comes from me making it. If the steps along the way are (1) keyman developer default new project, (2) modifications / more code, (3) build, (4) import into Keyman Desktop, then I don’t know where this could be failing. (1) and (2) are seemingly eliminated because you guys have gotten the keyboard to work (Though I don’t think anyone else is on Linux here?). (4) seems to be eliminated too, because I can install other keyboards just fine and they don’t misbehave. (3) was the one left to check, but I just tried building it in Windows and there’s the same issue. Not sure where the issue could be then…

My last thought left is that there is something in the default project that Keyman Developer creates that does not jive with Linux. That’s weird though, because one would assume many online keyboards would be affected (as I assume many are based on this default) and this would have been flagged before…

My SECOND last thought left is that maybe I’m just missing something basic about building and can’t help doing it wrong, regardless of operating system. Would one of you mind providing me with a .kmp file you’ve built from this code? I’d appreciate it.

Thanks again to all!

francais__alberta_.kmp (6.2 KB)

Note that I have seen (and STILL see, even though that post was closed…) a very similar problem to this, as described here:

But that is with Windows 11, Keyman 17.0.335, Firefox (I don’t see this problem with other browsers like Chrome), and it seems specifically with ESET antivirus installed. So a very different environment, but could these issues somehow be related?

(And one additional factor… The problem shows up when I am typing backspace in Google Docs, but it doesn’t really seem to occur when I am typing into other web pages.)

@jheath, I didn’t realize that discussion topic had been closed. Would you like turn that into an issue at New Issue · keymanapp/keyman?

Issues don’t get closed until they are actually resolved (or really no longer relevant), whereas discussion topics get closed after a period of inactivity (prevents spam and unrelated discussions hijacking threads too much).

That said, I doubt these two issues have a common cause, being on different operating systems and very different environments :grinning_face:

@JCode Here’s the .kmp built from your code with kmc 18.0.235 on Ubuntu 24.04:
francais__alberta_.kmp (5.7 KB)

I looked through our issues and found that I had experienced a similar problem a while ago, but was no longer able to reproduce recently: #9971.

  1. Are you running on X11 or Wayland (echo $XDG_SESSION_TYPE) ?

  2. Also, are you using Gnome Shell or something else?

  3. What do you get for the following commands?

echo $XDG_CURRENT_DESKTOP
echo $XDG_SESSION_DESKTOP
echo $XDG_SESSION_TYPE
dpkg -l keyman
dpkg -l ibus
  1. Does it work when you try it in gedit or Text Editor ?

Hi Eberhard, thanks for reply. I will try to answer as best I can.

  1. X11
  2. I don’t know what that is, sorry. Probably whatever Ubuntu has by default.
  3. The following is a copy-paste from my terminal. The two last commands were terminated with cntrl+z.

julien@comp:~$ echo $XDG_CURRENT_DESKTOP
ubuntu:GNOME
julien@comp:~$ echo $XDG_SESSION_DESKTOP
ubuntu-xorg
julien@comp:~$ echo $XDG_SESSION_TYPE
x11
julien@comp:~$ dpkg -l keyman
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=att>
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom Version Architecture Description
++±==============-=================-============-=============================>
ii keyman 17.0.335-1+focal1 all Type in your language with Ke>
…skipping…
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=att>
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom Version Architecture Description
++±==============-=================-============-=============================>
ii keyman 17.0.335-1+focal1 all Type in your language with Ke>
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set mark: …skipping…
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=att>
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom Version Architecture Description
++±==============-=================-============-=============================>
ii keyman 17.0.335-1+focal1 all Type in your language with Ke>
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

[1]+ Arrêté dpkg -l keyman
julien@comp:~$ dpkg -l ibus
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=att>
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom Version Architecture Description
++±==============-==================-============-============================>
ii ibus 1.5.29-2sil1~noble amd64 Intelligent Input Bus - core

[2]+ Arrêté dpkg -l ibus