Friday, November 13, 2020

Mouse Speed Profiler

UPDATE 1.1: Previous versions lost profiles because the mouse ids would change upon system restarts etc. That has hopefully been resolved with this version. Download link updated.

    
So I work from home or more recently at a friends house. I use my friends computer to get work done but he has multiple mice, and they are all set to different DPI settings and every time I use one or the other I have to go into the mouse control panel, and adjust the cursor speed setting so that its comfortable. I decided it would be some what fun and useful if I made a program to automate the process either entirely or as much as possible. I had an idea which later turned out not to work. I was originally going to poll the mice with DirectX and using their DeviceInstance GUIDs. But I couldn't distinguish the mice from each other. What ever I did I could not associate mouse data separately. I went to researching, It turns out that since DirectX 9.0 Microsoft has pulled the plug on unique mouse and keyboard instances. All mice are merged together into one GUID and that's that, same with Keyboard it seem (haven't tested but was mentioned). So I thought, lets go the RawInput route, I hated this route as this wouldn't allow me to Poll anymore from a console application. Not only was RawInput a pain in the ass to get working properly, it didn't seem like anyone really had any real examples online on how to go about doing it. People seemed to always be very vague like, "you need a window, have the window register for rawinputs", I'm over here think "is there any chance I can make DirectX work" but no I finally found some sample code which semi worked. The code sometimes worked... well rarely worked, more times then not it would crash the program and this is the demo program the author made. The crash wasn't normal either, no error messages, codes or anything, it simply just closed the program. So I went to troubleshooting and debugging. Voila!!! now that I can distinguish between multiple mice, I can now work on getting and setting the windows mouse speed setting. This wasn't so bad, some MSDN C++ docs and P/Invokes later and it was all done. Finally I have to turn these functionalities into an application.

    When the program runs, it loads a "speed.prf" file (if it exists) which stores any mouse profiles. While its running and becomes focused (via Alt+Tab) you can switch to which ever mouse you want to use. A new mouse window will popup if a new mouse has been detected. You give the mouse profile a name (the mouse id is used as default), and you set what you want the windows mouse speed to be and click save; while you are moving the slider the mouse speed is set accordingly as well. You can then do the same with another mouse, etc. Now the next time you want to switch mice, you Alt+Tab to the profiler, and just start using the mouse you want.

DOWNLOAD:
https://mega.nz/file/rFow1b4S#qUNEYFMNhKf-3wqbML9bawgAxF9VOvUtin3fdDBpDo4

Wednesday, July 8, 2020

A very basic Sudoku game

   Here is a Sudoku game I made a long time ago, going through my old projects I came across it and I thought why not put this up on my blog since I haven't posted anything in a while anyways. I might come back to this but writing it from scratch since this was written in vb.net and I have since moved mostly to C# with that maybe new features etc.

DOWNLOAD: https://mega.nz/file/jZ4DWQQK#xrQgbgHqIbsNs0VEnYeMfgbAomof8L3R9hmI-J5aoWA