Currently there is a bug in bqt, if you alt-tab out of Blender and back in, it will often perceive that the alt key is stuck. The same can happen with the shift or ctrl key (but alt-tab is the most common use-case where the bug becomes apparent).
I'm attempting a fix that catches at least some cases of this behavior by running a second operator along side the QOperator. The second operator is a regular Blender operator running modally and scanning inputs. I've also added a just_focused property on the BlenderApplication object, that we can check if - "Blender just got focused" (came back from Alt-Tab). In that case the modal operator will check if there's a keyboard event perceived and if that keyboard event contained any modifier key. We then simply send an emulated key release to the operating system.
Currently there is a bug in bqt, if you alt-tab out of Blender and back in, it will often perceive that the alt key is stuck. The same can happen with the shift or ctrl key (but alt-tab is the most common use-case where the bug becomes apparent).
I'm attempting a fix that catches at least some cases of this behavior by running a second operator along side the QOperator. The second operator is a regular Blender operator running modally and scanning inputs. I've also added a just_focused property on the BlenderApplication object, that we can check if - "Blender just got focused" (came back from Alt-Tab). In that case the modal operator will check if there's a keyboard event perceived and if that keyboard event contained any modifier key. We then simply send an emulated key release to the operating system.
Apparently Blender having trouble catching if any modifier keys have been released is not a new issue by bqt, but appears to be more common with bqt. E.g. see the following two older issues: https://developer.blender.org/T52905 https://developer.blender.org/T64105