8000 RPI Wired Keyboard 2 not working alongside usb mouse · Issue #278 · rsta2/circle · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RPI Wired Keyboard 2 not working alongside usb mouse #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stephaneweg opened this issue Feb 18, 2022 · 6 comments
Closed

RPI Wired Keyboard 2 not working alongside usb mouse #278

stephaneweg opened this issue Feb 18, 2022 · 6 comments

Comments

@stephaneweg
Copy link
stephaneweg commented Feb 18, 2022

( related to issue 273)

i am trying to test the example 08 (usb keyboard)
i have a raspberry pi official keyboard

  • when i plug the keyboard, it seems to be correctly detected
  • in the other issue, i had to add "usbignore=int3-1-1"

when i add it, the mouse works but the keyboard not
when i dont add it, the keyboard work, but not the mouse

this is because the keyboard is using interface int3-1-1

there is the log when i connect my keyboard:

usbdev1-2: Device ven5e3-610, dev9-0-2 found
usbdev1-2: product : usb2.0 hub
usbdev1-2: interface int9-0-1 found
usbdev1-2: function is not supported
usbdev1-2: interface int9-0-2 found
usbdev1-2: using device/interface int9-0-2
usbdev1-2-1: Device ven4d9-6 found
usbdev1-2-1: Product: RPI Wired Keyboard 2
usbdev1-2-1: interface int3-1-1 found
usbdev1-2-1: usign device/interface int3-1-1
usbdev1-2-1: interface int3-0-0 found
usbdev1-2-1: usign device/interface int3-0-0
usbhub: Port 1: Device configured
usbhub: Port 2: Device configured

is it possible to have a patch, to tell the usbstack to ignore the int3-1-1 for the mouse only, but use it when it is for a keyboard ?

@stephaneweg
Copy link
Author
stephaneweg commented Feb 18, 2022

I managed to implement a patch

step 1 : add a method "FindString" in the CString class (strstr is fine)

char* CString::FindString(const char *pString) const
{
	return strstr(m_pBuffer,pString);
}

step 2: in the UsbDevice class, add a property to returns the product name (it get it in the initialize method, the Product variable can be moved to an instance variable, then you add a GetProduct method to returns this variable as const char*

const char *CUSBDevice::GetProduct(void) const
{
	return  (const char *)Product;
}

step 3: in the UsbDeviceFactory class: when it try to returns the keyboard for the interface 3-1-1, replace the existing content by

        else if (pName->Compare ("int3-1-1") == 0)
	{
		CString productName = pParent->GetDevice()->GetProduct();
		if (productName.FindString("Keyboard"))
		{
			pResult = new CUSBKeyboardDevice (pParent);
		}
		
		else
		{
			CLogger::Get ()->Write ("ufactory", LogWarning,
					"Ignoring interface %s (Not a keyboard)", pUSBIgnore);
		}
	}

step3: remove the "usbignore=int3-1-1" from the cmdline.txt file
after that, my mouse and my keyboard worked together correctly

@stephaneweg stephaneweg changed the title RPI Wired Keyboard 2 not working RPI Wired Keyboard 2 not working alongside usb mouse Feb 18, 2022
@rsta2
Copy link
Owner
rsta2 commented Feb 18, 2022

Yes, with the mouse workaround, suggested in issue #273, it's not possible to use an USB keyboard parallel to the mouse. Thanks for suggesting a patch, which works so that you can use your keyboard and mouse together. Unfortunately some USB keyboards do not have the string "Keyboard" in the product string or do not have a product string at all. Because there are more of such workarounds in the meantime, it is necessary to implement a more general solution for this problem. I have to think about this.

rsta2 added a commit that referenced this issue Feb 19, 2022
Do not load driver for specific USB interfaces for:

* HP USB 1000dpi Laser Mouse, Issues #273 and #278
* Apple Aluminum Mini Keyboard, Issue rsta2/minisynth#18
@rsta2
Copy link
Owner
rsta2 commented Feb 19, 2022

I added a solution, which is quiet similar to yours on the develop branch. It uses the vendor and product ID to detect your mouse and to prevent loading a driver for the USB keyboard interface then. Is it possible to test this with your mouse and keyboard? Thanks for giving the hint!

@stephaneweg
Copy link
Author

your workaround works for me, when i plug my mouse, it does not try to return a keyboard device

@rsta2
Copy link
Owner
rsta2 commented Mar 1, 2022

Good to know. Thanks for testing!

@rsta2
Copy link
Owner
rsta2 commented Mar 11, 2022

This workaround is in Circle 44.4.

@rsta2 rsta2 closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0