Microsoft Windows sometimes it detects other serial devices as a serial mouse. If the device is connected to a real TIA-232 port or a Universal Serial Bus (USB) to TIA-232 adapter. Some USB connected devices, e.g. GPS receivers, have USB to TIA-232 convertors built right into the device. This Viam module disables the serial mouse if Windows has re-enabled it.
https://paulhutch.blog/2019/06/24/disable-serial-mouse-detection/
This module provides the following model:
- Model viam-soleng:windows-serialmouse:disable
Call the DoCommand of this model to apply two registry changes that stop Windows from treating the serial line as a serial mouse:
-
Disable the
sermouseservice. The module queries the registry and, ifStartis 3, changes it to 4.Location: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\sermouse Key: Start Value: 3 -> 4 -
Skip serial port enumeration. For every built-in serial port instance under
PNP0501, the module writes aSkipEnumerationsDWORD of0xffffffffso Windows stops polling those COM ports for a mouse. TheDevice Parameterssubkey and value are created if they do not already exist.Location: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum\ACPI\PNP0501\<instance>\Device Parameters Key: SkipEnumerations (DWORD) Value: 0xffffffffPNP0501is the ACPI ID for the built-in 16550 serial port. A device on a USB-to-serial adapter or a different ACPI ID will not be covered by this step.
There are no configuration attributes required for this module.
There are no configuration attributes required for this module.
{
}This module implements the DoCommand. Periodically send it an empty {} via the Viam Job Scheduler.
{
}{
"start": 4,
"changed": true,
"message": "Start value changed from 3 to 4",
"enumeration_disabled_ports": [
"System\\CurrentControlSet\\Enum\\ACPI\\PNP0501\\1\\Device Parameters"
]
}changed— whether thesermouseStartvalue was updated this call (falseif it was already 4).enumeration_disabled_ports— the ports where we disabled serial-mouse enumeration; that is, theDevice Parameterspaths whereSkipEnumerationswas written. Empty if noPNP0501serial port instances were found.