映射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

腾讯云2核4GB内存8M带宽 年74元

一般大厂都是通过首年才有可以享受爆款活动,然后吸引我们注册他们商家达到持续续费和购买的目的。一般只有大厂才能有这样的魄力和能力首年亏本,但是对于一般的公司和个人厂家确实难过,这几年确实看到不少的同类商家难以生存。这里我们可以看到有对应的套餐方案。不过这两个套餐都是100%CPU独享的,不是有某云商家限制CPU的。但是轻量服务器有个不好的就是带宽是较大且流量是限制的额,分别是1GB和1.2TB月流量...

GeorgeDatacenter:洛杉矶/达拉斯/芝加哥/纽约vps云服务器;2核/8GB/250GB/2TB流量/1Gbps端口,$84/年

georgedatacenter怎么样?GeorgeDatacenter是一家2017年成立的美国商家,正规注册公司(REG: 10327625611),其实是oneman。现在有优惠,有几款特价VPS,基于Vmware。支持Paypal付款。GeorgeDatacenter目前推出的一款美国vps,2核/8GB内存/250GB NVMe空间/2TB流量/1Gbps端口/Vmware/洛杉矶/达拉...

热网互联33元/月,香港/日本/洛杉矶/韩国CN2高速线路云主机

热网互联怎么样?热网互联(hotiis)是随客云计算(Suike.Cloud)成立于2009年,增值电信业务经营许可证:B1-20203716)旗下平台。热网互联云主机是CN2高速回国线路,香港/日本/洛杉矶/韩国CN2高速线路云主机,最低33元/月;热网互联国内BGP高防服务器,香港服务器,日本服务器全线活动中,大量七五折来袭!点击进入:热网互联官方网站地址热网互联香港/日本/洛杉矶/韩国cn2...

键盘映射为你推荐
学员flashdestoondestoon多少人是从PHP168过来的啊?Destoon的B2B很好,强烈支持你们cisco2960配置cisco4506与2960的vlan配置sqlserver2000挂起安装sqlserver2000时总提示有挂起操作!波音737起飞爆胎为什么很少见到飞机轮胎爆胎?flashfxp下载求最新无需注册的FlashFXP下载地址生药http汉字cuteftp爱买网超谁有http://www.25j58.com爱网购吧网站简介?可信网站网站备案了,还要验证可信网站吗?他们有什么区别
西部数码vps duniu raksmart 42u标准机柜尺寸 typecho 最好看的qq空间 河南移动m值兑换 绍兴电信 in域名 测试网速命令 中国联通宽带测试 accountsuspended 标准机柜 studentmain vim命令 台式机主机 大容量存储模式 ibm服务器机柜 深圳公租房申请网站 北京共有产权房申请网站 更多