How can I translate Linux keycodes from /dev/input/event* to ASCII in Perl?

后端 未结 4 667
梦谈多话
梦谈多话 2020-12-15 14:06

I\'m writing a Perl script that reads data from the infamous /dev/input/event* and I didn\'t find a way to translate the key codes generated by the kernel into

4条回答
  •  既然无缘
    2020-12-15 14:32

    Example 1 only gives you back the same key code values that are already coming from the linux kernel. For example you get KEY_A 0x1e for an 'a' key press. What you want is (and what i want) is the ascii conversion so if 'a' is pressed I want to see 0x61 for lower case and 0x41 for upper case.

提交回复
热议问题