Disable right click menu for physical mouse (settlers 2)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7915
    eldarkt
    Participant

    Hi all!

    I have one more issue with physical mouse 🙂

    My devices are: Samsung Galaxy S8 + Bluetooth mouse “Microsoft Bluetooth mouse”.
    To scroll the map in “Settlers 2” game I need to hold right click and move the mouse.

    When I do this (hold right click on the physical mouse), after about two seconds the system menu (with 3 options “input mode”, “general settings” and “keyboard”) pops out, and also virtual cursor becomes visible (unfortunately this cursor wasn’t recorded in the video for some reason), so I have to hide it again.

    Video here:
    https://1drv.ms/v/s!AlG9tVXDm9d3hKJiXERrtk5bxnndSQ?e=eZmsS7

    Is it possible to somehow disable this system menu?
    Otherwise scrolling the map is not really convenient 🙂

    Thanks!

    #7916
    adminadmin
    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”.

    #7917
    eldarkt
    Participant

    Hello there!
    First of all thanks again for the Magic DosBox, I wish I could rate it at 100 stars, this DosBox is just great 🙂

    So, I tried to remap but it didn’t help…
    I also tried to remap the built-in phone button (volume up), just for a test, and it did work.

    So we can say that the remapping feature, in general, does work on my phone, it just doesn’t with the physical mouse.
    Also, I noticed that during the process of remapping I can hold right-click forever, and this menu doesn’t show up.

    Video here (sorry for my English):
    https://1drv.ms/v/s!AlG9tVXDm9d3hKJjIjdwehHTvQEP9w?e=35m7JS

    P.S. feel free to give up this troubleshooting if you feel that it’s not possible to fix that, I understand that fixing this kind of hardware/software issue is not always feasible…

    #7918
    adminadmin
    Keymaster

    Many thanks. In the past I created application for debugging events coming to mdosbox application from system. That application is on google play in beta stage, you cant see it on store, but you can join beta testing. Please can you send me email? For next two days I will not be available due Easter. But then I like to see log from your device. May happen that event for menu will be not delivered to mdosbox and then I cant do nothing…

    #7919
    eldarkt
    Participant

    Please can you send me email?

    Done, I sent an e-mail to your contact from the google store.

    For next two days I will not be available due Easter. But then I like to see log from your device

    Sure, there is no urgency, take your time 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.