On 04/05/2021 11.14, Gerd Hoffmann wrote: > On Sat, May 01, 2021 at 09:06:21PM +0200, Rainer Müller wrote: >> When multiple keyboards are passed to the guest with input-linux, there >> could still be keys pressed on the other keyboard when toggling grab. >> Delay toggling grab on the other keyboard until all keys are released, >> otherwise keys could be stuck on host without a key up event. > > Hmm, if you have two keyboards plugged into your machine, why would you > assign both to a virtual machine? Instead of simply using one for the > host and one for the guest?
Fair enough. I only noticed the possibility during testing. I plugged in a second keyboard for development to avoid locking myself out and passed only one. Then I became confident to pass them both, but mostly because I already had them connected. I agree it does not seem like a typical setup... This was the only code path that did not check !il->keycount before calling input_linux_toggle_grab(), so I added it here as well. Maybe it would make sense to move the condition into the function? Rainer