Overload right click behaviour

Hello,
I would like to overload right click mouse behaviour so it does not act like the return button. My main goal is to play FPS games with Steam link. The right click close the game, which is annoying. Does anybody have an idea to do so ?

Cheers,
Mathieu

framework/native/services/inputflinger/InputReader.cpp

    ......
    CursorButtonAccumulator::getButtonState() const {
    ......
    if (mBtnRight) {
        char targetProduct[PROPERTY_VALUE_MAX] = {0};
        property_get("ro.target.product", targetProduct, "");
        if (strcmp(targetProduct, "box") == 0 || strcmp(targetProduct, "atv") == 0) {
-           result |= AMOTION_EVENT_BUTTON_BACK;
+           result |= AMOTION_EVENT_BUTTON_SECONDARY;
        } else {
            result |= AMOTION_EVENT_BUTTON_SECONDARY;
        }
    }
    }
    ......

Hello, I would like to overload right click mouse behaviour so it does not act like the return button. My main spacebar clicker goal is to play FPS games … But you should ask yourself, do you really want to overwrite default right - click behavior - it depends on application that you’re developing … A right - click menu or context menu in a browser is a menu with multiple choices that appears on right - click mouse operation. Here is how you can create a custom context ( right - click ) menu for your web application.