uterm: input: add flag to input-events marking them as handled

If multiple handlers are called on the same input-event, we must notify
handlers whether the event was already handled by a previous callback. We
push this decision to the handlers by allowing them to modify the
"handled" flag for an input event.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: remove plain backend

We made xkbcommon mandatory some time ago and there is no reason to keep
this plain backend around anymore. It isn't tested at all and provides no
real advantage over xkb.
Even for debugging it is easier to use XKB.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: use uxkb directly

This changes the uterm-input infrastructure to use XKB directly instead of
using a modularized infrastructure. There is no need to use something else
anymore.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: add support for multiple keysyms

xkbcommon supports reporting multiple keysyms per key-event. There is no
keymap which uses this, yet. However, this feature is not meant to enhance
performance by reducing the number of calls into xkb, but instead multiple
keysyms are to be handled as one big keysym.
But there are no examples, yet, so we cannot actually perform any
conversions on them. But we can add the infrastructure for it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: vte: use ASCII keysyms for ctrl+<XY> shortcuts

If a user has multiple active XKB layouts but only one of them has ASCII
keysyms on the base level, then ctrl+<XY> might actually never work,
because these keys aren't available in the current layout. This patch
tries to find a layout of the user that actually _has_ ascii keysyms on
the base level and passes this information along with the normal keysym
information.

The TSM layer can now use this ascii keysym instead of the normal unicode
keysym to handle ctrl+<XY> shortcuts. This is the same way xterm et. al.
handle this, so it seems to be a good idea to do this in TSM, too.

Reported (and mainly written) by Ran Benita.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: misc: add shl_dup() helper

shl_dup() duplicates a memory region similar to strdup() but without
reading the data length via strlen().

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: vt: reset KBMODE to K_UNICODE if it was K_OFF

If we switch to a VT that has KBMODE set to K_OFF, we do not set it back
to K_OFF when leaving, instead, we set it to K_UNICODE. This allows
recovering when kmscon died by simply restarting kmscon.

There is really no need to let a VT stay in K_OFF! This causes the user to
be stuck at this VT and use the sysrq (if enabled) keys to recover.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm: input: implement software key-repeat

To allow users to specify key-repeat rates/delays, we now implement
software key-repeat. This is mostly copied from wlt_toolkit.c which
already does this.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add --xkb-repeat-rate/delay command-line arguments

These new arguments allow changing the xkb-repeat settings for kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>