rampa3 / 3DDashOnScreen

A NeosModLoader mod for Neos VR that replaces 2D overlay dash in Screen mode with the regular 3D one.
MIT No Attribution
4 stars 1 forks source link

Restoration of context menu bind for opening control panel for Desktop tab #6

Open art0007i opened 2 years ago

art0007i commented 2 years ago

this is a huge problem, as every time i press the letter n on my virtual keyboard it will open that menu. luckily there is a way to fix it in config but i think that feature is pretty useless anyway and could be removed completely. if you have a good use for it please tell me as I don't see a single purpose for the desktop tab in desktop

rampa3 commented 2 years ago

I use it to switch onto a null plug in HDMI to make a fake monitor, but definitely I think it is not used by many people. Still, if it would be possible to add a condition to check for VR, it would be preferable. But yeah, I might be only person using this.

art0007i commented 2 years ago

Oh that's an interesting application for it, well anyway the best option would be to do what happens in vr normally (when you try to open a context menu while hovering over the desktop tab it would instead open that popup), easiest option is just to disable that bind in vr

art0007i commented 2 years ago

after some research I have found that the DesktopInteractionRelay.ShouldProcessEvent function contains a call to InputInterface.ScreenActive which is there to prevent you from moving your desktop cursor using your desktop tab, but also prevents the context menu clicks

art0007i commented 2 years ago

Changing this one bool at the beginning of the DesktopInteractionRelay.ProcessEvent seems to do the trick

public bool ProcessEvent(Canvas.InteractionData eventData)
{
    if (!this.ShouldProcessEvent())
    {
-        return false;
+        return true;
    }
    (...)
]
rampa3 commented 2 years ago

Changing this one bool at the beginning of the DesktopInteractionRelay.ProcessEvent seems to do the trick

public bool ProcessEvent(Canvas.InteractionData eventData)
{
    if (!this.ShouldProcessEvent())
    {
-        return false;
+        return true;
    }
    (...)
]

Gooing to fix this ASAP, just have to finish a university project code first, since I am on tight deadline. Btw, I looked into the ShouldProcesEvent() method, and I am thinking about making it think VR is always active in there...

art0007i commented 2 years ago

I am thinking about making it think VR is always active in there...

Well if you do that then you will be able to actually interact with with your desktop tab on desktop... usually this means that when you hover over it, it will fling your view in a random direction because it's moving your mouse.

rampa3 commented 2 years ago

Whoops! Did not thought that one trough, since the two mouse locations being reported will contest for the cursor...

rampa3 commented 2 years ago

Wasn't able to get the context menu binding to work, but I fixed the keyboard bind by adding check for if screen mode is active, which must be positive to make the key work now. I will push the update now, but leave this issue open for discussion of the context menu bind.