Reply To: Disable right click menu for physical mouse (settlers 2)

#7916
admin
Keymaster

Hello,

I know this issue, your system detects holding right click and simulates menu key which was present on old devices and from some android version it was virtual, 3 dots on navigation bar. I fixed it several times, but seems manufacturers still finds way how to brick it. And in some cases it is not possible to fix. I can check sources.

EDIT : Yes, it’s fixed in the code, with note :D. Probably menu key is not identified like coming from physical mouse. I simulate right mouse click if mdosbox obtains menu key and source is physical mouse :

        if (keyCode == KeyEvent.KEYCODE_MENU && isKeyEventFromPhysicalMouse(event)) {
            PhysicalMouse.mouseButtonFix(down, 2);
            return true;
        }
boolean isKeyEventFromPhysicalMouse(KeyEvent event) {
        //MotionEvent has function getToolType to get correct source hardware, however keyevent has nothing like this
        //We must use this shitty detection which does not work at 100%
        int source = event.getSource();
        return (source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE || (source & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE;
    }

Looking further in the code, I see potential fix with re-mapping key. It could work. Can you try this :

In mdosbox menu, while game runs, press back button and go to mapper and tilt or voodoo menu (menu in which you re-map keys to something else). Open “buttons” section and new mapping. There try hold mouse for detecting menu key. This step is critical, hope it will be detected. If is detected then add it, but bind nothing, let it on “none”.