Android如何键盘按键响应事件

/**
   * Use with setDefaultKeyMode to launch the dialer during default key
   * handling 将键盘所有的按键传递到拨号
   */
  setDefaultKeyMode(DEFAULT_KEYS_DIALER);
  /**
   * Use with setDefaultKeyMode to turn off default handling of keys.
   * 直接丢弃,这种情况你把键盘按穿了也不会有系统理你
   */
  setDefaultKeyMode(DEFAULT_KEYS_DISABLE);
  /**
   * Use with setDefaultKeyMode to specify that unhandled keystrokes will
   * start a global search (typically web search, but some platforms may
   * define alternate methods for global search) 将键盘输入作为搜索内容,进行全局搜索
   * 保证当前处于英文输入模式,可以通过呼出一个软键盘来改变当前输入模式。
   */
  setDefaultKeyMode(DEFAULT_KEYS_SEARCH_GLOBAL);
  /**
   * Use with setDefaultKeyMode to specify that unhandled keystrokes will
   * start an application-defined search. (If the application or activity
   * does not actually define a search, the the keys will be ignored.)
   * 将键盘输入作为搜索内容,进行本地搜索,如果本地没有实现自定义搜索,则会被忽略.
   */
  setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
  /**
   * Use with setDefaultKeyMode to execute a menu shortcut in default key
   * handling. That is, the user does not need to hold down the menu key to execute
   * menu shortcuts.
   * 将键盘输入作为当前窗体上注册的快捷键,进行快捷键处理
   */
  setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值