Option to make mouse cursor stick to the center of the screen
-
My neck hurt at the mere thought of this concept… but I’m sure some people would find it useful. I also have some moderate scarring between T1 and C1, so I’m no measure of a target users of this kinda feature.
That being said, programmatically it is one of the more simple things that could be done. There are a number of ways this could be improved, but wanted to try it out and see if it would work well enough. I whipped up a bog-standard console application that will keep the mouse centered when the BMS program is in focus if you wanna try out this concept right away @Sneakpeek
__
Here is a copy of this console application pre-compiled and ready to run for the Falcon BMS process: https://www.dropbox.com/…/MouseCenteringUtility-BMS.zip
# Mouse Centering Utility # by SemlerPDX Jan2022 # https://github.com/SemlerPDX/MouseCenteringUtility This is a very simple mouse centering console application which forces the mouse to remain centered when the Falcon BMS process is in focus. When this utility program is running, and BMS is in focus, the mouse cannot be moved from center - use ALT+TAB to switch to this console app to close it. Being so simple, this can easily be improved upon, but can serve a purpose to test and explore the concept of a forced centered mouse using Falcon BMS in VR. USE: 1. Start Falcon BMS and get into the cockpit of a mission 2. When ready for a locked/centered mouse, run "MouseCenteringUtility.exe" 3. When you return to Falcon BMS, the mouse will be locked 4. ALT+TAB to this console app and close it to disable mouse centering
__
And here is a link to the GitHub repository if someone would rather pull & compile it for themself, or review/improve upon my code - be sure to follow instructions in the readme: https://github.com/SemlerPDX/MouseCenteringUtility
-
@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.
But if you need a low cost way to interact with the pit, my proposal might be worth a try.
@chihirobelmo Thanks a lot! That’s great news. Really cool, that you guys listen to the community!
BTW in DCS it’s this Option here (just as a reference):@SemlerPDX Great (except for the part about your neck. Hope it gets better over time)! Thanks for the code. I’ll have a look at it tomorrow. I would have tried it with Java (java.awt.Robot to the rescue), but it’s always a hassle to ship the whole runtime along with the tiny program.
Cheers,
SPEdit: I mean the “Use mouse” option on the screenshot…
-
@Sneakpeek I used a .NET Core console application with a target framework of .NET 5.0 for maximum compatibility with other systems, and can run on Windows, Linux, or macOS. Can definitely be improved upon, but I commonly whip up little utilities like this in C# using Visual Studio because it’s simple, fast, and a small package - this one has just 4 files in addition to the .exe and I didn’t bother with an icon or any dross.
Bog-standard concept tester, might even actually work until U1/U2 implementation of a proper system but no doubt could use some QoL improvements at the very least. -
@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.