按鼠标右键,映射到Jelly Bean中穿越回工作 [英] mouse right button mapped to work for traversing back in Jelly Bean

查看:367
本文介绍了按鼠标右键,映射到Jelly Bean中穿越回工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经改变了code的某些部分在'框架/基/服务/输入/ inputreader.cpp使鼠标右键单击工作穿越回来。

We have changed some part of code in `framework/base/services/input/inputreader.cpp to make the mouse right click work for traversing back.

case BTN_RIGHT:
    mBtnRight = rawEvent->value;
    break;

case BTN_RIGHT:                       
    mBtnBack = rawEvent->value;
    break;

据接收所有的鼠标events.when我点击鼠标右键,它接收移动事件以及关键events.But它无法调度关键事件。

It is receiving all the mouse events.when I click the mouse right button it is receiving motion events as well as key events.But it is not able to dispatch key events.

它给错误:

D/InputDispatcher( 1229): dispatchKey - eventTime=1352984476958100000, deviceId=2, source=0x2002, policyFlags=0x42000000, action=0x1, flags=0x0, keyCode=0x4, scanCode=0x0, metaState=0x0, repeatCount=0, downTime=1352984476958100000
D/InputDispatcher( 1229): Waiting for application to become ready for input: AppWindowToken{41294900 token=Token{411c0f90 ActivityRecord{41301e68 com.android.calculator2/.Calculator}}} - Window{413ff3c0 com.android.calculator2/com.android.calculator2.Calculator paused=false}.  Reason: Waiting because the focused window has not finished processing the input events that were previously delivered to it.
D/InputDispatcher( 1229): findFocusedWindow finished: injectionResult=-1, timeSpentWaitingForApplication=0.0ms


它是在果冻豆?


Is it a bug in Jelly Bean?

推荐答案

为使鼠标Right_click工作,因为后退按钮做以下更改。这是为我工作。

To make mouse Right_click to work as Back Button do the following changes. it is working for me.

 in function reset(InputDevice* device) {

            replace mBtnRight = device->isKeyPressed(BTN_RIGHT); line to

                    mBtnBack =  device->isKeyPressed(BTN_RIGHT);

             and 
  in function process(const RawEvent* rawEvent) {

              remove  3 lines   case BTN_RIGHT:
                                mBtnRight = rawEvent->value;
                                break;
                     and Add "case BTN_RIGHT:" before case BTN_BACK:" as shown below

                     case BTN_RIGHT:
                     case BTN_BACK:                       
                     mBtnBack = rawEvent->value;
                     break;

/ *这就是所有它是为我工作。 * /

/*Thats all it is working for me. */

这篇关于按鼠标右键,映射到Jelly Bean中穿越回工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆