Option to make mouse cursor stick to the center of the screen
-
@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:
-
I usually use the option that comes with VoiceAttack for mouse commands.
You have several configuration options within the app. In the menu UI, campaign, … it works perfectly, but the moment you enter the 3D cockpit, the cursor and the actions of Voice Attack do not respond.
-
@Fisu said in Option to make mouse cursor stick to the center of the screen:
I usually use the option that comes with VoiceAttack for mouse commands.
You have several configuration options within the app. In the menu UI, campaign, … it works perfectly, but the moment you enter the 3D cockpit, the cursor and the actions of Voice Attack do not respond.
If you can’t resolve your issue with VoiceAttack not working once in the 3D Cockpit, hop on over to the VoiceAttack Discord, people glad to help out.
https://voiceattack.com/discordIt would probably be best not to use this thread to troubleshoot your issues which are not related to this thread and the discussion here. You could also make a new forum post here, many of us use VoiceAttack.
If I knew offhand some simple trick I could tell you in one reply to fix it, I would. Instead, best you visit VA Discord and/or make your own forum post with an appropriate named title that will attract other users who may be able to help.
-
@SemlerPDX, I’m dealing with the issue of mouse centering in the 3D view. For example, in DCS the centering of the mouse cursor on the screen works without problem while in VR.
-
So, you are not playing BMS in VR? Because I also cannot seem to hook the mouse in 3D view (while not in VR) in order to center it. This may be because of some interpretation layer.
All I know for sure is that mouse centering does work for VR, at least for the users above who reported such while using the alpha proof-of-concept console app linked a few posts up).
The cursor action in your command may not be recognized by BMS, but keypress actions are. It’s only a mouse movement in non-VR 3D Pan Cockpit View Mode that seems to not center.
-
Just the update here since U1 added this natively (thanks anyway @SemlerPDX!)
.cfg options:
g_b3DClickableCursorFixToCenter //designed for non-VR usersg_b3DClickableCursorFixToCenterIfVR
The .key callbacks:
SimToggleCursorCenter
SimClickButtonLeft
SimClickButtonRightToggle cursor allows you to map to a button or key command to have normal control of your cursor back or lock back to your center headtracked view. ClickButtons allow you to map mouse clicks to something other than the actual mouse keys.
Thanks BMS team!!!
-
@Snake122 lmao! Hilarious timing - I just wrapped up final testing last night, with just packaging and links and posts to make today. All done now, anyway…
Well, I’ve gone ahead and released it just the same - still has mouse scroll wheel rebinds which is unique. As I said to airtex in a chat, I can’t really learn something new regarding programming unless I have a project that will use it, in order to have a “thing” to produce, and so even if redundant and unused, this was an invaluable endeavor and I learned how to develop WPF Apps for .NET Framework following an MVVM structure. To me, that’s priceless and I’m quite glad for the experience.
If you wanna check it out, here’s the link - I like the visual style and was happy it was able to be packaged in a self-contained .exe with no need for an installer, just works out of wherever it is executed from.
Nothing lost and everything gained, I’ve got a framework on my website, my GitHub, and in Visual Studio now that could let me develop any such apps in the future very quickly and focusing more on the art and functions (the fun stuff) rather than the structures like deployment and errors logging, or even figuring out how to property write a WPF app. Sky’s the limit now, that’s for sure. As I said, it was a priceless experience.
https://forum.falcon-bms.com/topic/24463/mousemastervr-mouse-functions-utility-app
-
@SemlerPDX will do! I was already following you on GitHub with my other main internet handle but hadn’t checked since earlier this week. I get it completely wanting to learn code that way. I have a very rough C++ program that at makes my 3rd Space vest work as G feedback with DCS. So I’m excited to see it and will be downloading it to try it out, thank you!