映射android键盘映射

键盘映射  时间:2021-04-14  阅读:()

android键盘映射

Android bottom and middle tier common learning series Androidkeyboard mapping collection

(reprinted please explain from the largest Android communityin China, androidin bottom drive forum branch, the largestLinux community in the country, Linuxforum embedded Linuxbranch)

(Email: hongj iuj ing@gmail.com)

This article is suitable for beginners, say wrong place,welcome to correct and perfect. Daniel can bypass ^ ^)introducefunction

Key layout mapping

Selection of key mappingsf ile format

Key layout mapping file example

Key character mapping

Selection of key character mappingsf ile format

Resource binary file format

Improve your own drive

Listed

Introduce:

This paper describes how the key input is translated into thebehavior information of the Android application layer and howto customize the layout of keys and key character mapping tablesto meet the needs of the equipment.

Note:

The application of Android is not just a tablet computer, MID,phone, you can also put the STB set-top boxes, smart hometerminal to the above, so the key is to map custom, regardlessof whether the button is fixed on the equipment, or throughwireless or Bluetooth remote control equipment, mapping allneed keys.

Android is also the core of Linux, and most of the time it isthe operating system that performs tasks in scheduling tasks.Accordingly, the Android input system also follows the LINUXinput input and output subsystem, and the analysis of this partcan be Google, and there are many fundamental aspects of theanalysis. Android uses the standard Linux input event device(/dev/event0) , and the driver description allows you to viewthe kernel tree header file include/linux/input.h. If you want

to go further into Linux input subsystem, you can access:http://git.kernel.org/, p=linux/k, /linux-2.6.24.y.git,a=blob, f=Documentation/input/input. txt

Note: event0 is your keypad/gpio-keyregistration to the kernelnode number, if there are other input devices registered intothe kernel, you can also be event1.

Functionality

Android inputs event devices, using interrupts (hardwaretriggers) or polling structures (software simulations) tocapture device specific scan codes and translate them intostandard kernel acceptable events via input_event () .The other main driving driving key mapping is to construct aprobe function for polling function, simulation registerinterrupt your software or hardware initialization, usinginput_register_device () registered driver/ equipment to theinput and output system.

Note: about the probe belongs to the Linux device driver modelknowledge, you can read the LDD3 or LINUX device driverPrinciple and practice, described in great detail.

The following table describes the conversion steps from thekeyboard input to the corresponding application behaviorStep behavior interpretation

The 1 window manager from Linux keyboard keyboard event key

messages do not specifyany logic event, which is only connectedwith the hardware related to the location, that is to say, thekey code of the keyboard software without any meaning, mappingthe keyboard code

The 2 window manager scans the scan code as key. When the windowmanager reads a key from the driver, it uses the key layoutmapping file to map the scan code to the key value. In particular,this key is the bar code displayed on the screen. for exampleKEYCODE_DPAD_CENTER is a five bit key intermediate navigationkeys, even if ALTG produces a "?" character, the fact thatKEYCODE_G is the key.

The 3 window manager sends a scan code and key code to theapplication, scan code and key code is the current focus ofinterface processing, specific "translation" depends on thespecific application.

Key layout mapping

How do I select a key layout mapping file?

The key layout mapping file is usually placed in

/system/usr/keylayout and /data/usr/keylayout

For each keyboard device XXX, set the system propertyandroid.keylayout.xxx, if you do not create a specific devicefor their own hardware, Android will read the configurationf ile /system/usr/keylayout/qwerty.kl.

Note: if you set system properties, seettp://www.kandroid.org/android_pdk/build_new_device.htmlFile format:

The keymapping file is usually stored in aUTF8 text file format,usually with the following characteristics:

Note: the initial content will be ignored.

Blank: all blank lines are ignored

Key definition: the key definition follows the following formatkey, SCANCODE, KEYCODE, [FLAGS, . . . ] when the scan code is anumber, the key code is defined in the layout fileandroid.keylayout.xxx you describe, and you can also set therelevant FLAGS:

SHIFT: when pressed, the SHIFT key is automatically addedALT: when pressed, automatically add ALT

CAPS: when pressed, automatically bring CAPS capitalsWAKE: when pressed, when the device goes to sleep, press thisbutton to wake up,

And send messages to the application layer.

WAKE_DROPPED:when pressed and the device is asleep, the deviceis awakened, but does not send messages to the application

layer.

Keyboard mapping file example:

Android/src/device/product/generic/tuttle2.kl2007 The Android Open Source Copyright # ProjectKey 21

Key 32

Key 43

Key 54

Key 65

Key 76

Key 87

Key 98

Key 109

Key 110

Key 158, BACK, WAKE_DROPPED

Key 230, SOFT_RI GHT, WAKE

Key 60, SOFT_RIGHT, WAKE

Key 107, ENDCALL, WAKE_DROPPEDKey 62, ENDCALL, WAKE_DROPPED

Key 229, MENU, WAKE_DROPPED

Key 59, MENU, WAKE_DROPPED

Key 228, POUND

Key 227, STAR

Key 231, CALL, WAKE_DROPPED

Key 61, CALL, WAKE_DROPPED

Key 232, DPAD_CENTER, WAKE_DROPPEDKey 108, DPAD_DOWN, WAKE_DROPPEDKey 103, DPAD_UP, WAKE_DROPPEDKey 102, HOME, WAKE

Key 105, DPAD_LEFT, WAKE_DROPPEDKey 106, DPAD_RI GHT, WAKE_DROPPED

Key 115, VOLUME_UPKey 114, VOLUME_DOWNKey 116, POWER, WAKEKey 212, SLASH

Key 16, Q

Key 17, W

Key 18, E

Key 19, R

Key 20, T

Key 21, Y

Key 22, U

Key 23, I

Key 24, O

Key 25, P

Key 30, A

Key 31, S

Key 32, DKey 33, FKey 34, GKey 35, HKey 36, JKey 37, KKey 38, LKey 14, DELKey 44, ZKey 45, XKey 46, CKey 47, VKey 48, BKey 49, NKey 50, M

NameCheap新注册.COM域名$5.98

随着自媒体和短视频的发展,确实对于传统的PC独立网站影响比较大的。我们可以看到云服务器商家的各种促销折扣活动,我们也看到传统域名商的轮番新注册和转入的促销,到现在这个状态已经不能说这些商家的为用户考虑,而是在不断的抢夺同行的客户。我们看到Namecheap商家新注册域名和转入活动一个接一个。如果我们有需要新注册.COM域名的,只需要5.98美元。优惠码:NEWCOM598。同时有赠送2个月免费域名...

BuyVM迈阿密KVM上线,AMD Ryzen 3900X+NVMe硬盘$2/月起

BuyVM在昨天宣布上线了第四个数据中心产品:迈阿密,基于KVM架构的VPS主机,采用AMD Ryzen 3900X CPU,DDR4内存,NVMe硬盘,1Gbps带宽,不限制流量方式,最低$2/月起,支持Linux或者Windows操作系统。这是一家成立于2010年的国外主机商,提供基于KVM架构的VPS产品,数据中心除了新上的迈阿密外还包括美国拉斯维加斯、新泽西和卢森堡等,主机均为1Gbps带...

SugarHosts糖果主机,(67元/年)云服务器/虚拟主机低至半价

SugarHosts 糖果主机商也算是比较老牌的主机商,从2009年开始推出虚拟主机以来,目前当然还是以虚拟主机为主,也有新增云服务器和独立服务器。早年很多网友也比较争议他们家是不是国人商家,其实这些不是特别重要,我们很多国人商家或者国外商家主要还是看重的是品质和服务。一晃十二年过去,有看到SugarHosts糖果主机商12周年的促销活动。如果我们有需要香港、美国、德国虚拟主机的可以选择,他们家的...

键盘映射为你推荐
学员flash副刊2016年8月30日uctools为什么一直服务器暂不可用http500ZTCS500在哪能下载手机QQ?netshwinsockresetwin7系统我在输入netsh winsock reset后错误代码11003求大神解决上不了网ipad代理如何贷款买IPAD解析cuteftp滴滴估值500亿滴滴出行股权项目投资怎么投 100w怎么可以投资不购物车什么叫淘宝购物车腾讯公司电话腾讯总公司服务热线是多少
域名备案信息查询 域名备案批量查询 标准机柜尺寸 个人域名 卡巴斯基官方免费版 老左正传 hinet 免费申请网站 鲁诺 搜索引擎提交入口 七夕快乐英语 双12 东莞idc 网页提速 东莞服务器托管 云服务器比较 阿里云邮箱怎么注册 九零网络 sonya 更多