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

MineServer:洛杉矶CN2 GIA VPS/512MB内存/20GB NVME/800GB流量/200Mbps/KVM,58元/季

mineserver怎么样?mineserver是一家国人商家,主要提供香港CN2 KVM VPS、香港CMI KVM VPS、日本CN2 KVM VPS、洛杉矶cn2 gia端口转发等服务,之前介绍过几次,最近比较活跃。这家新推出了洛杉矶CN2 GIA VPS,512MB内存/20GB NVME/800GB流量/200Mbps/KVM,58元/季,并且进行了带宽升级,同时IP更改为美国IP。点击...

华为云年中聚惠618活动,新用户专区,云服务器低至88元/年,3年仅580.98元,热销抢购中,最后2天!

华为云怎么样?华为云用在线的方式将华为30多年在ICT基础设施领域的技术积累和产品解决方案开放给客户,致力于提供稳定可靠、安全可信、可持续创新的云服务,做智能世界的“黑土地”,推进实现“用得起、用得好、用得放心”的普惠AI。华为云作为底座,为华为全栈全场景AI战略提供强大的算力平台和更易用的开发平台。本次年终聚惠618活动相当给力,1核2G内存1m云耀云服务器仅88元/年起,送主机安全基础版套餐,...

打开海外主机域名商出现"Attention Required"原因和解决

最近发现一个比较怪异的事情,在访问和登录大部分国外主机商和域名商的时候都需要二次验证。常见的就是需要我们勾选判断是不是真人。以及比如在刚才要访问Namecheap检查前几天送给网友域名的账户域名是否转出的,再次登录网站的时候又需要人机验证。这里有看到"Attention Required"的提示。我们只能手工选择按钮,然后根据验证码进行选择合适的标记。这次我要选择的是船的标识,每次需要选择三个,一...

键盘映射为你推荐
searchaspsns平台sns是什么平台企业推广最常见的推广方式有哪些德国iphone禁售令德国买iPhone现在多少钱?波音737起飞爆胎为什么很少见到飞机轮胎爆胎?重庆网站制作我想做个网站,我是重庆的人。想在本地找个做网站的公司,请教一下在重庆那个公司比较好一点,,,,谢谢400电话查询400电话。如何查询真伪,费用?免费代理加盟怎么开免费的代理网店申请400电话400电话如何申请?discuz伪静态discuz怎么才能把专题目录也实现伪静态的方法详解
国外域名注册 网游服务器租用 俄罗斯vps com域名抢注 草根过期域名 国内免备案主机 谷歌香港 免费名片模板 500m空间 服务器维护方案 isp服务商 vip域名 万网空间购买 东莞服务器托管 中国联通宽带测试 大化网 云销售系统 密钥索引 锐速 免费赚q币 更多