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;
        }
    }
    }
    ......