Option to make mouse cursor stick to the center of the screen
-
@jayb basically the same as the dcs “don’t use mouse” option. DCS version, when you untick use mouse for Vr, is a small blue cross in the centre of your view.
But, it doesnt need to be tied to pointctrl or such like, it’s really intuitive when paired with hotas binds for left and right click.
That way, look at switch, press hotas button. Done.
-
@SemlerPDX I love little one-file C# apps like this.
I opened a few issues, for suggestions.
https://github.com/SemlerPDX/MouseCenteringUtility/issues -
@Sneakpeek said in Option to make mouse cursor stick to the center of the screen:
@jayb Yeah, you nailed it! That’s exactly what I mean.
PointCtrl is a bit more comfortable, as you can interact with most controls in your peripheral view without having to exactly look at it. That’s a lot better for your neck.
Cheers,
SPI see your point, not having to turn your head 1:1 towards what you would like to click is more comfortable. So PointCtrl still holds an advantage in that respect.
A neck-saving variation could be to look at, say, the right MFD with cursor initially dead-center of viewport. Let’s assume that the dead-center is exactly mid-screen for the MFD and we want to press a button on the MFD. That would be a bit off-center (unless we move the head and thereby the cursor). Then for finer movement of the cursor away from mid-screen to the button, one could use the radar cursor on HOTAS (possibly in a shifted state).
That way the cursor could be moved anywhere within the current view, ie. contact any peripheral object.
-
@Sneakpeek Is there a left hand version?? I’ve been looking at these before, just never pulled the trigger because don’t know how they perform. Do you still need a mouse pad/surface for it to work on?
-
we need to focus on fixes for U1 and this feature can be pushed for U2 or later.
-
@jayb There’s already an app called VR Necksafer which works with DCS and IL2: https://gitlab.com/NobiWan/vrnecksafer. It’s not compatible with BMS yet. Maybe if someone suggests it to the developer.
@chihirobelmo No prob. Fixes go first. I fully understand that - especially as there is a way to fix this by third party software.
@spotdott I tried to find a left-hand-version, but I couldn’t find one. But it might work for you anyway - you’d have to try.
If you use it on your right hand, you put it on your index finger and press the buttons with your thumb. This should also be possible with your left hand, too. The downsides are, that the left and right mouse buttons would be swapped and the IR sensor would be facing towards you. The IR sensor is meant for moving the mouse cursor around by holding it close to a surface and moving it around. Even clothes do suffice in that case. But this whole thread is about moving the mouse cursor with your head (by centering it on the screen). That way you wouldn’t need the IR sensor anyway. Without a way of centering the mouse cursor on the screen, the index finger mouse isn’t doing much good for our cause. In that case, I’d rather use a trackball. -
@SemlerPDX It works quite good. Thanks again for your work.
My thoughts about this:
- The “hitboxes” of the controls might have to be enlarged for this (or for PointCtrl for that matter) to be more comfortably.
- I had to set my Window Mode to fullscreen (because I have two monitors and the cursor position is derived from the active BMS window.
- I had to set
g_b3DClickableCursorAnchored
to0
for this to work. When snapping to the nearest control, the cursor just stays there until it disappears again. - It doesn’t really work in 2D. Maybe you could make use of BMS Shared Memory (there’s a flag that tells you if you’re In Flight or not. But it’s just OK now, if you don’t wanna put in more effort.
Cheers!
SP -
@Sneakpeek Well, since we just got confirmation that it will be awhile before something like this is implemented into BMS natively, I’m happy to take suggestions and fixes and improve this little utility for standard use & general public distribution.
I’ll post up here once I’ve committed these and other QoL changes to the main branch on GitHub - will try to have a proper functioning app completed by next week.
-
I have a little mouse that looks like a pointctrl device - it wraps around a finger, worn a bit like a ring, has left and right clicks on it. It was about £5 off Amazon. I think this might be a good budget pointctrl in combo with Semler’s “hack”. Will report back.
-
@rubbra Hi Rubbra, please check the first post of this thread. There’s a link to Amazon. Do you mean this device?
-
@Sneakpeek no, not that (I’d already seen it, having read the whole thread).
Thumbs Up Wireless Gyro Finger… https://www.amazon.co.uk/dp/B0937J99Z9?ref=ppx_pop_mob_ap_share
-
I’m abandoning the console app as an excuse to get into WPF App framework… I’ve done a lot with Windows Forms before, but WPF is the new hotness that all the kids are raging about. So, I’ve been going back and forth between Visual Studio and Photoshop to make a fancy looking jet-themed GUI panel for this ultra simple utility tool that will really only be useful for the few weeks (months?) before a mouse centering option is integrated into BMS through U1 or U2 this year.
Still, I’m having fun, learning a lot, and had always needed such an excuse to dive into this WPF stuff… it will have an auto-updater through GitHub or NuGet, which will just run when the app starts up, and user options for Auto, Manual (a pop-up window with url links), or None. Manual will be the default. Like before, users will be able to download a compiled version that works, or to grab it off GitHub and compile it for themselves.
I’ll include a remapper for setting any joystick button as a Mouse Left Button, and for mouse scroll wheel so up/down can be set to keystrokes. The metal bar along the bottom expands/collapses the user options section in this tiny app.
WIP & subject to change … but it’s shaping up nicely
The screw in the top right is the close button
…and with the options expanded:
TLDNR; I should have the first public version available before next week at the latest, but I’m shooting for end of week. I’d like to see if I can get it to watch the BMS Shared Memory so it only locks the mouse when we’re not in menus or 2D cockpit view or other such states - I assume the 3D Pan Cockpit mode would be the only place we’d want the mouse lock to engage. Honestly, if I can just get the updater in place, I can add or refine it later, and users can enjoy the basic functionality of a mouse lock with this new GUI as I add the remapper and other QoL improvements in the coming days/weeks.
-
Even without Semler’s utility, getting the HMCS aligned, then leaving the mouse cursor in the centre of the HMCS cross allows for good head control of clicks.
I just use joystick gremlin to remap HOTAS buttons to left and right click as per the image below.
-
@Sneakpeek said in Option to make mouse cursor stick to the center of the screen:
@SemlerPDX It works quite good. Thanks again for your work.
My thoughts about this:
- The “hitboxes” of the controls might have to be enlarged for this (or for PointCtrl for that matter) to be more comfortably.
- I had to set my Window Mode to fullscreen (because I have two monitors and the cursor position is derived from the active BMS window.
- I had to set
g_b3DClickableCursorAnchored
to0
for this to work. When snapping to the nearest control, the cursor just stays there until it disappears again. - It doesn’t really work in 2D. Maybe you could make use of BMS Shared Memory (there’s a flag that tells you if you’re In Flight or not. But it’s just OK now, if you don’t wanna put in more effort.
Cheers!
SPOkay - a bit of a small update: Should be finished by end of weekend. Have just a few more “fun” things to do, but needed to double-verify that this works cuz my VR is put up in a box, and when I fire up BMS without VR, mouse centering doesn’t work (with my old console app, or my new hotness pictured above). I’ll just take it on faith that it works as you said for when in VR.
Yes, absolutely would need to turn off the Cursor Anchor setting. I will make sure that is prominent in instructions/download page when finished. It now has access to shared memory and the cursor will not center when not flying, though that is as fine control as I can give it and can’t tell if in other view modes where we might want mouse control instead like outside the cockpit, and such. I made it possible to target any process, too, so ofc the shared mem only works when Falcon BMS is the target - this will extend the life of this little utility for anyone who needs it down the road for VR applications or other purposes, in addition to the mouse scroll wheel keypress rebind.
This way, when BMS has native mouse centering option for VR one day, the app can still serve some purposes if not only in BMS, but wherever.
Anyway, back to it … Just wanted to share that update. Having fun learning how to make WPF apps and will likely never make a Windows Form app ever again now
-
@SemlerPDX if it helps, your utility doesn’t do anything to my mouse in VR either.
-
Yeah, unfortunately with the zipped file’s MouseCenteringUtility.exe doesn’t seem to run anything. Sorry I am not quite up to trying to compile it myself from github @SemlerPDX But hoping to use this with PointCTRL exactly how @rubbra wants to with his mouse device. Ironically, they will both become just basic mouse clickers for now
Also I know beggars can’t choosers, but I have been running 4.37 traditional full screened due to VR filling my second MFD monitor making alt-tab dicey. But if I have to, I’ll look at using a black splash screen to fix this since I’ve been using “set g_bVRnoPresent 1” and it’s the splash screen that fills everything in windowed VR.
-
@Snake122 said in Option to make mouse cursor stick to the center of the screen:
Yeah, unfortunately with the zipped file’s MouseCenteringUtility.exe doesn’t seem to run anything.
The function inside that .exe should try to force the mouse to the center of the screen when Falcon BMS is in focus. While that early proof of concept .exe was primitive, I can test its function easily by running it, then running Falcon BMS and at the main menu my mouse cannot be moved from the center of the screen. I have to ALT-TAB to the MouseCenteringUtility.exe and close it to regain mouse movement.
If you are not getting this behavior, it does cause some concern for me because that might mean the method I am using to move the mouse programmatically may not be consistent across all platforms. I am on Windows 10, which has (at least) the .NET Framework 4.8 - I was under the impression that this method would work for all versions of windows going back to Vista (but possibly not XP).
@Sneakpeek To be clear: Does that little .exe works for you to keep the mouse centered when in VR? Because the much cooler app version that I’m building using that concept uses the same method just with a nice wrapper and ON/OFF toggle switch (and a couple other goodies).
Would help me to know now if/why it works for some but not all users.
-
@SemlerPDX said in Option to make mouse cursor stick to the center of the screen:
the method I am using to move the mouse programmatically may not be consistent across all platforms. I am on Windows 10
yeah this is the concern I was alluding to, being unable to test in VR. I don’t remember what SetCursorPos() does for multi-mon systems… or GetSystemMetrics(SM_SCREEN) etc. and I also don’t know what GetForegroundWindow()/GetWindowRect() etc will return for a game running in fullscreen-exclusive mode. Or process.GetMainWindow() etc.
It’s an app with very little code, but a very big test-matrix.
I think the key dimensions to test for your app, are less about Windows version and NetFx version, more about:
- fullscreen-exclusive vs borderless-window
- multi-monitor (ie. running BMS on a monitor that’s not “primary” windows desktop … which I think is the case with VR? not sure)
- running VR with/without the desktop companion-window
- last but (maybe) not least, high-DPI and multi-mon with variable DPIs
-
@SemlerPDX it is working for me now! It was probably RTFM issue for me having BMS open, but not in the cockpit yet when I ran it first I think. Win10 here.
-
@Snake122 Thank you very much for the confirmation!
No, that early .exe is so dumb that it will force center when in the main menu AND in the cockpit. The new hotness of “isFlying” is part of the new (coming soon) app with the fancy toggle button and such. (with much thanks to JanJan and Tumbler )
No worries, glad to know it works for you. Chatting with airtex about adding some extra controls to test an alternate means of centering for potential different end case scenarios as described above.
Also added a mouse Right Click rebind cuz just makes sense… here’s a WIP teaser pic of what it looks like this weekend, with the ‘Rebind Mouse Scroll UP’ menu active and capturing any keypress to set/save as the new scroll up keypress action: