如何在Perl中将Linux键码从/dev/input/event *转换为ASCII? [英] How can I translate Linux keycodes from /dev/input/event* to ASCII in Perl?

查看:272
本文介绍了如何在Perl中将Linux键码从/dev/input/event *转换为ASCII?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Perl脚本,该脚本从臭名昭著的/dev/input/event*中读取数据,但是我没有找到将内核生成的键代码转换为ASCII的方法.

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 ASCII.

我在此表这里并且我似乎找不到能够在不将数组硬编码到脚本中的情况下帮助我翻译它们的东西.我想念什么吗?

I'm talking about the linux key codes in this table here and I can't seem to find something that would help me translate them without hardcoding an array into the script. Am I missing something?

我想跳过数组部分,因为这似乎不是一个好习惯,所以有什么主意吗? :)

I'd like to skip the array part because it doesn't seem to be a good practice, so any idea? :)

推荐答案

这基本上是地图问题.您必须输入一个键码并查找其ASCII等效项.您认为数组部分"不好吗?

It's basically a map problem. You have to take a keycode and lookup its ASCII equivalent. What about the "array part" do you think is not a good practice?

我在CPAN上没有看到用于此目的的模块,但这意味着您有机会第一个上载它. :)

I didn't see a module for this on CPAN, but that means that you have a chance to be the first to upload it. :)

这篇关于如何在Perl中将Linux键码从/dev/input/event *转换为ASCII?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆