VOGONS

Common searches


First post, by videogamer555

User metadata
Rank Member
Rank
Member

I wrote this program in VB6. It uses Windows API to read raw HID (human interface device) data from the real USB mouse attached to your computer. By doing so, instead of getting the current cursor's position on the screen, it gets the x/y movement values sent from the actual mouse. And these are what is needed to generate a proper serial mouse data packet. From there it uses the Winsock ActiveX control to send the packet.

When the program first starts, it attempts to connect to IP address 127.0.0.1 and port 1234. After about one second, if no server program is listening on that port, my program closes. To make my program work with DosBox, use notepad and load your DosBox config file, and in the serial port configuration set serial port 1 to:
serial1=nullmodem port:1234
Then save the config file. Then start DosBox. After DosBox is running, start my serial mouse emulator. Then run a program that you know absolutely requires a serial mouse (such as Windows 1.0, and don't use the modded version that is actually using the Windows 2.0 PS2 mouse driver, or maybe play some really old game that requires a serial mouse). It should work perfectly, just as if you were using a real serial mouse. If you don't want to see both your real mouse cursor and the one in DosBox both at the same time, you can make DosBox grab your real cursor, which makes it disappear. To do this, press Ctrl+F10 in DosBox. Press Ctrl+F10 again to make DosBox release control of your real cursor.

Here's something to note. As my serial mouse emulator uses the Winsock ActiveX control for the TCP connection, you will need to have a copy of the file MSWINSCK.OCX in your system folder (Windows\System32 on 32bit Windows, or Windows\SysWOW64 on 64bit Windows). This OCX file comes with VB6 when you install it, and also I think in some older versions of Windows, but not in anything newer than Windows XP. I could have created an installer package for my program that would have installed this dependency, but since you may already have the file, I felt it was easier to post it as a separate download here. If you don't already have MSWINSCK.OCX installed on your computer, you will need to copy it to the correct system folder (as mentioned above), and then you will need to run the following 2 commands from a command prompt with administrator privilege:
cd c:\windows\system32 (or if in 64bit Windows, use cd c:\windows\syswow64)
regsvr32 MSWINSCK.OCX
That will install the Winsock ActiveX control on your system. Then the serial mouse emulator program should run fine.

Also note that sometimes my program locks up when it first starts, at least on my PC. I traced this back to my copy of Norton Antivirus somehow interfering with its operation. It's not because it detects it as a virus (it doesn't, it finds it completely clean/uninfected), but rather somehow its scanning process (which involves injecting virus scanner threads into the running program, in order to monitor the program for suspicious behavior) is itself sometimes causing interference in the program's normal execution. I found that one specific feature of Norton Antivirus is responsible for this problem. It's called "SONAR Protection". If you disable just that one Norton feature (and leave all of the other antivirus/security features running), then my serial mouse emulator will always run without a problem. I would highly recommend permanently disabling that one feature as it has caused problems in other programs too, and it seems to do so more in ones written in VB6.

Attached to this message are 2 files:
Serial Mouse Emulator.exe
MSWINSCK.zip (I put the OCX file into the ZIP file, because the attachment system here didn't let me directly attach the OCX file)

Attachments

  • Filename
    MSWINSCK.zip
    File size
    55.69 KiB
    Downloads
    98 downloads
    File comment
    This is required for the serial mouse emulator to work.
    File license
    Fair use/fair dealing exception
  • Filename
    Serial Mouse Emulator.exe
    File size
    24 KiB
    Downloads
    117 downloads
    File comment
    Allows your normal USB mouse to be used as a serial mouse in DosBox. Connects to 127.0.0.1:1234
    File license
    Fair use/fair dealing exception

Reply 1 of 7, by olddos25

User metadata
Rank Member
Rank
Member

Tried it on a Windows 7 laptop and it really works! This is useful for the ones that need it!

Currently mod on several Discord servs and a forum, so you can trust me if you want a DOSBox mod here!
Other places to find me:
DraStic: drastic-ds.com (as dsattorney)
EPForums: www.epforums.org (as emulationfan)

Reply 2 of 7, by ProphetPX

User metadata
Rank Newbie
Rank
Newbie

This program works great but is there any support in it for the scroll wheel on my mouse? I did everything as you said but i do not know how to enable scroll wheel support?

I used it to setup an old copy of AutoCAD R11 inside DOSBOX under Windows 10 x64 😁
And it works great -- except the mouse wheel.

IF it is enabled in your emulator then what am i missing?

videogamer555 wrote:
Show quote

I wrote this program in VB6. It uses Windows API to read raw HID (human interface device) data from the real USB mouse attached to your computer. By doing so, instead of getting the current cursor's position on the screen, it gets the x/y movement values sent from the actual mouse. And these are what is needed to generate a proper serial mouse data packet. From there it uses the Winsock ActiveX control to send the packet.

When the program first starts, it attempts to connect to IP address 127.0.0.1 and port 1234. After about one second, if no server program is listening on that port, my program closes. To make my program work with DosBox, use notepad and load your DosBox config file, and in the serial port configuration set serial port 1 to:
serial1=nullmodem port:1234
Then save the config file. Then start DosBox. After DosBox is running, start my serial mouse emulator. Then run a program that you know absolutely requires a serial mouse (such as Windows 1.0, and don't use the modded version that is actually using the Windows 2.0 PS2 mouse driver, or maybe play some really old game that requires a serial mouse). It should work perfectly, just as if you were using a real serial mouse. If you don't want to see both your real mouse cursor and the one in DosBox both at the same time, you can make DosBox grab your real cursor, which makes it disappear. To do this, press Ctrl+F10 in DosBox. Press Ctrl+F10 again to make DosBox release control of your real cursor.

Here's something to note. As my serial mouse emulator uses the Winsock ActiveX control for the TCP connection, you will need to have a copy of the file MSWINSCK.OCX in your system folder (Windows\System32 on 32bit Windows, or Windows\SysWOW64 on 64bit Windows). This OCX file comes with VB6 when you install it, and also I think in some older versions of Windows, but not in anything newer than Windows XP. I could have created an installer package for my program that would have installed this dependency, but since you may already have the file, I felt it was easier to post it as a separate download here. If you don't already have MSWINSCK.OCX installed on your computer, you will need to copy it to the correct system folder (as mentioned above), and then you will need to run the following 2 commands from a command prompt with administrator privilege:
cd c:\windows\system32 (or if in 64bit Windows, use cd c:\windows\syswow64)
regsvr32 MSWINSCK.OCX
That will install the Winsock ActiveX control on your system. Then the serial mouse emulator program should run fine.

Also note that sometimes my program locks up when it first starts, at least on my PC. I traced this back to my copy of Norton Antivirus somehow interfering with its operation. It's not because it detects it as a virus (it doesn't, it finds it completely clean/uninfected), but rather somehow its scanning process (which involves injecting virus scanner threads into the running program, in order to monitor the program for suspicious behavior) is itself sometimes causing interference in the program's normal execution. I found that one specific feature of Norton Antivirus is responsible for this problem. It's called "SONAR Protection". If you disable just that one Norton feature (and leave all of the other antivirus/security features running), then my serial mouse emulator will always run without a problem. I would highly recommend permanently disabling that one feature as it has caused problems in other programs too, and it seems to do so more in ones written in VB6.

Attached to this message are 2 files:
Serial Mouse Emulator.exe
MSWINSCK.zip (I put the OCX file into the ZIP file, because the attachment system here didn't let me directly attach the OCX file)

Reply 3 of 7, by olddos25

User metadata
Rank Member
Rank
Member

I don't think so. My laptop does not have a wheel to begin with, so I can't test this.
PD: I'm back!

Currently mod on several Discord servs and a forum, so you can trust me if you want a DOSBox mod here!
Other places to find me:
DraStic: drastic-ds.com (as dsattorney)
EPForums: www.epforums.org (as emulationfan)

Reply 4 of 7, by videogamer555

User metadata
Rank Member
Rank
Member
ProphetPX wrote:
Show quote

This program works great but is there any support in it for the scroll wheel on my mouse? I did everything as you said but i do not know how to enable scroll wheel support?

I used it to setup an old copy of AutoCAD R11 inside DOSBOX under Windows 10 x64 😁
And it works great -- except the mouse wheel.

IF it is enabled in your emulator then what am i missing?

Scroll wheel support? There is no such thing as a scroll wheel on a serial mouse. The serial mouse was invented before the scroll wheel was even dreamed of. The serial data packets don't support a scroll wheel, so there's nothing to emulate in this regard. I'd need to make a new data packet type, but that would no longer be compatible with the serial mouse specification, so it wouldn't work on old programs that require a real serial mouse (only on ones that were created nowadays to specifically support such a custom serial protocol)

Reply 5 of 7, by youplaboom07

User metadata
Rank Newbie
Rank
Newbie

Hi videogamer555,
would it be possible to have your Serial Mouse Emulator program to output to any serial port, virtual or real, like COM1 or 2?
I need a way to feed a COM port with serial mouse data.
Would you share your sources?
Thanks

Reply 6 of 7, by cyclone3d

User metadata
Rank l33t
Rank
l33t
youplaboom07 wrote:
Show quote

Hi videogamer555,
would it be possible to have your Serial Mouse Emulator program to output to any serial port, virtual or real, like COM1 or 2?
I need a way to feed a COM port with serial mouse data.
Would you share your sources?
Thanks

Thid should be possible to program.. but if this program doesn't support it, there is a project that allows you to use a Raspberry Pi to allow you to convert a USB mouse to serial.

Yamaha YMF modified setupds and drivers
Yamaha XG resource repository - updated November 27, 2018
Yamaha YMF7x4 Guide
AW744L II - YMF744 - AOpen Cobra Sound Card - Install SB-Link Header
Epstein didn't kill himself