Closed Johennes closed 3 years ago
For "normal letters" data->key = in.code;
should work instead of data->key = 0;
in the default
branch of the switch case
.
It really works only for ASCII letters. Isn't there a way to get the "real" letters, e.g. shift + a = A
?
It seems that libxkbcommon would be able to do the translation from key codes to key symbols based on the current key map. I'll have to do some more research to understand what would be required to hook into that.
Looks like libxkbcommon is working pretty ok for me so far. We'd only have to add a config setting for the key map to use. E.g. this is what I use with my laptop keyboard:
struct xkb_rule_names names = {
.rules = NULL,
.model = "pc105",
.layout = "de",
.variant = "nodeadkeys",
.options = NULL
};
Good news! :slightly_smiling_face:
We'd only have to add a config setting for the key map to use.
Shall we add parts of this config to lv_drv_conf.h
?
Yeah, good idea. :+1:
Let me play with it some more and then I'll try to put it into a pull request.
When using the
LV_INDEV_TYPE_KEYPAD
type, the evdev driver supports a limited number of keys (backspace, enter, up right, left, down). Any other keys are ignored. It would be great if the driver would handle input from a regular keyboard so that, for instance, typed characters are forwarded into a textarea.I'm not sure if there is a better way to achieve this other than adding further cases for the relevant key codes and handling things like SHIFT manually.
Maybe ASCII characters or characters found on common US English keyboard layouts would be enough for a start as that would limit the amount of
switch
ing.I'm curious if you'd be open to adding this to lv_drivers and would be happy to help implement it.