android 按键映射文件,《android 的按键映射表》.doc

《android 的按键映射表》.doc

Keymaps and Keyboard Input

This document describes how keyboard input gets translated into Android actions and how you can customize key layout and key character maps to match the needs of your own device.

Android uses the standard Linux input event device (/dev/event0) and driver as described in the linux/input.h kernel header file. For more information regarding standard Linux input drivers, please see Linux Input drivers at .

Android's input event device is structured around an interrupt or polling routine that captures the device-specific scancode and converts it to a standard form acceptable to Linux (as defined in input.h) before passing it to the kernel with input_event().

The keymap driver's other primary function is to establish a probe function that sets up the interrupt or polling function, handles hardware initialization, and attaches the driver to the input subsystem with input_register_device().

The table below describes the steps required to translate from keyboard input to application action:

StepActionExplanation1.Window manager reads key event from Linux keyboard driver. Events are typically positional. For example, the top-left position on a keypad returns 16 regardless of whether that key is printed with a Q (as on a QWERTY keypad) or an A (as on an AZERTY keypads). This first conversion by the Linux Keyboard Driver yields a scancode (for example, 16).2. Window manager maps scancode to keycode.When the window manager reads a key event out of the driver, it maps the scancode to a keycode using a key layout map file. Typically, the keycode is the primary symbol screen-printed on a key. For example, KEYCODE_DPAD_CENTER is the center button on the five-way navigation control. Even though ALT + G generates a "?" character, KEYCODE_G is the keycode.3. Window manager sends both the scancode and the keycode to the application.Both the scancode and keycode are handled by the view with focus. How the application interprets both depend on the

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值