I tried to debug this issue with a simple JavaScript script to log some events. While I cannot reproduce the exact same issue (i.e., the key “disappearing” from the input) I am able to see some inconsistencies between IBus and Plasma Keyboard.
The script:
<!DOCTYPE html>
<html>
<body>
<textarea id="k" rows="6" cols="60"></textarea>
<br />
<button id="dump">Dump</button>
<script>
const events = [];
function snapshot(event)
{
const el = event.target;
const e = {
type: event.type,
key: event.key,
code: event.code,
which: event.which,
keyCode: event.keyCode,
charCode: event.charCode,
data: event.data ?? null,
inputType: event.inputType ?? null,
composed: event.composed,
isComposing: event.isComposing,
value: el?.value ?? null,
selectionStart: el?.selectionStart ?? null,
selectionEnd: el?.selectionEnd ?? null,
};
console.log(e);
events.push(e);
}
const k = document.getElementById('k');
k.value = '';
['keydown', 'keypress', 'keyup', 'beforeinput', 'input', 'change', 'compositionstart', 'compositionupdate', 'compositionend']
.forEach((type) => k.addEventListener(type, snapshot));
k.focus();
document.getElementById('dump').addEventListener('click', () => console.log(JSON.stringify(events, null, 2)));
</script>
</body>
</html>
Results:
Firefox: IBus Wayland (KDE)
[
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionstart",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionupdate",
"which": 0,
"data": "´",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionupdate",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "beforeinput",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionend",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "change",
"data": null,
"inputType": null,
"composed": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
}
]
Firefox: Plasma Keyboard (KDE)
[
{
"type": "keydown",
"key": "Dead",
"code": "BracketLeft",
"which": 0,
"keyCode": 0,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionstart",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "keydown",
"key": "Dead",
"code": "BracketLeft",
"which": 0,
"keyCode": 0,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionupdate",
"which": 0,
"data": "´",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "Dead",
"code": "BracketLeft",
"which": 0,
"keyCode": 0,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "a",
"code": "KeyA",
"which": 65,
"keyCode": 65,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionupdate",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "beforeinput",
"which": 0,
"data": "",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "keydown",
"key": "a",
"code": "KeyA",
"which": 65,
"keyCode": 65,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionend",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "keydown",
"key": "Process",
"code": "KeyA",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "á",
"inputType": "insertText",
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertText",
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "a",
"code": "KeyA",
"which": 65,
"keyCode": 65,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "change",
"data": null,
"inputType": null,
"composed": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
}
]
Firefox: IBus Wayland (GNOME)
[
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionstart",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionupdate",
"which": 0,
"data": "´",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "Dead",
"code": "BracketLeft",
"which": 0,
"keyCode": 0,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "Process",
"code": "",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionupdate",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "beforeinput",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionend",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "a",
"code": "KeyA",
"which": 65,
"keyCode": 65,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "change",
"data": null,
"inputType": null,
"composed": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
}
]
The Plasma Keyboard test has some inconsistencies:
compositionupdate with an empty value field
beforeinput with an empty value field
input with an empty data field
compositionend with empty data/value fields
Same tests on Chromium:
Chromium: IBus Wayland (KDE)
[
{
"type": "compositionstart",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionupdate",
"which": 0,
"data": "´",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionupdate",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "´",
"selectionStart": 0,
"selectionEnd": 1
},
{
"type": "beforeinput",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 0,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionend",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "change",
"data": null,
"inputType": null,
"composed": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
}
]
Chromium: Plasma Keyboard (KDE)
[
{
"type": "keydown",
"key": "Process",
"code": "BracketLeft",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionstart",
"which": 0,
"data": "",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "compositionupdate",
"which": 0,
"data": "´",
"inputType": null,
"composed": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "beforeinput",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "",
"selectionStart": 0,
"selectionEnd": 0
},
{
"type": "input",
"which": 0,
"data": "´",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "Dead",
"code": "BracketLeft",
"which": 219,
"keyCode": 219,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keydown",
"key": "Process",
"code": "KeyA",
"which": 229,
"keyCode": 229,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionupdate",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "´",
"selectionStart": 0,
"selectionEnd": 1
},
{
"type": "beforeinput",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "´",
"selectionStart": 0,
"selectionEnd": 1
},
{
"type": "input",
"which": 0,
"data": "á",
"inputType": "insertCompositionText",
"composed": true,
"isComposing": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "compositionend",
"which": 0,
"data": "á",
"inputType": null,
"composed": true,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "keyup",
"key": "a",
"code": "KeyA",
"which": 65,
"keyCode": 65,
"charCode": 0,
"data": null,
"inputType": null,
"composed": true,
"isComposing": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
},
{
"type": "change",
"data": null,
"inputType": null,
"composed": false,
"value": "á",
"selectionStart": 1,
"selectionEnd": 1
}
]