Platform: Windows
Prerequisite: Basic Python, Visual Studio
License: MIT License
This project should work on Windows 7 & above, 32-bit Python. It’s completely free and open-source.
Are you looking for a programmatically controllable Mousemux? Here might be a good place to start! In this project I have included an example of Python client code that creates a Mouse class and click given position without moving the system cursor. If you have the vmulti device correctly set up, you should be able to use it right away!
Step 1️⃣
Clone the repo.
Step 2️⃣
Search “Windows Driver Kit 7.1.0” and download it to your PC. After you installed it, the default location should be something like C:\WinDDK\7600.16385.1. It’s also fine if you use versions above it. There will be a slight difference, but I will explain that later.
Step 3️⃣
Build the project with
build -wgcYou should see a new folder called objfre_win7_amd64 under \sys. Yours could be different.
Step 4️⃣
If your PC system is 64-bit, you will need to sign the driver, or you can enable Test Mode. Here I will teach you how to sign the driver.
- Locate “Inf2Cat.exe” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64. - Locate “SignTool.exe” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64. - Locate “pvk2pfx” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64. - Locate “MakeCert” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64.
Now cd to amd64, run
Inf2Cat.exe /driver:. /os:7_X64,10_X64This creates a catalog file called “vmulti.cat”. Next, run
signtool sign /v /fd SHA256 /f "C:\vmulti.pfx" /p YourPassword /t http://timestamp.digicert.com vmulti.catReplace YourPassword with the password you like. You should see a new file “vmulti.pfx” under “C:” if things go right. Now find it and double click it. Click Local Machine -> Next -> Next -> Enter your password -> Place all certificates in the following store ->
Select Trusted Root Certification Authorities -> Next -> Finsh.
Next generate a self-signed certificate by
makecert -r -pe -n "CN=VMulti Certificate" -ss My -sr LocalMachine -a sha256 -cy authority -sky signature -sv C:\vmulti.pvk C:\vmulti.cerLastly, generate a .pfx file for driver signing.
pvk2pfx -pvk C:\vmulti.pvk -spc C:\vmulti.cer -pfx C:\vmulti.pfx -po YourPasswordStep 5️⃣
- Locate “devcon.exe” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64. - Locate “hidkmdf.sys” under
vmulti\hidmapper\objfre_win7_amd64\amd64\, copy&paste that tosys\objfre_win7_amd64\amd64. - Locate “WdfCoInstaller01009.dll” under
C:\WinDDK\7600.16385.1\, copy&paste that tosys\objfre_win7_amd64\amd64.
Attention: If you are using other versions of Driver Kit, your “WdfCoInstaller” might be in a different version. In that case, modify “vmulti.inf” under sys\objfre_win7_amd64\amd64 to match your version. (Replace WdfCoInstaller01009.dll with things like WdfCoInstaller01011.dll)
After you finished all of the above, run
devcon install vmulti.inf djpnewton\vmultiYou should see a pop-up menu saying that you are installing the driver, agree it.
Step 6️⃣
Now verify you have the driver installed. Press Win+X and select Device Manager, scroll down to “Human Interface Devices”, see if you can find “VMulti HID”. If you did, the installation was successful. You see also be expecting two new devices under “Mice and other pointing devices”. Now that you have the driver installed, you should be able to run the Python example.
Step 7️⃣
This step is for development. It will require Visual Studio. I am using Visual Studio 2015 (2017) but you can try to use your own (reload the solution see what happen). Here is the download link for 2015: https://stackoverflow.com/a/44290942
Go to Visual Studio Installer, make sure you have the following components:
- MSBuild
- VC++ 2017
- Windows 10 SDK
- Visual C++ tools for CMake
Open the project in VS and reload the solutions if needed. By default the configuration type is .dll, you can change it to .exe in properties if you wanna do some other kinds of tests. For example, from the original repo:
Run testvmulti.exe /multitouch to move the cursor via virtual multitouch (only available on Win7 and above)Run testvmulti.exe /mouse to move the cursor via virtual mouseRun testvmulti.exe /digitizer to move the cursor via virtual digitizerIf you intend to use Python, “.dll” is more important. After you have modify the code, rebuild the solution and a new .dll file will be generated under vmulti\Debug. Like the one I have attached in vmulti\DLL, you can copy&paste it to your Python project and the Mouse class should be able to use it.
To-Do
Probably won’t have time but I will just list them. Free feel to open up a Pull Request if you got any of them implemented, I am very looking forward to it.
- Make more additional mice instead of just one
- Freely control “Press down” & “Release” mouse
- Dragging
- Position
💗 If you liked this blog, consider following me on GitHub.
🍯 Happy Coding 🍯