You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Holding both the left and right keys for a modifier at the same time confuses pynput as to whether subsequent events for these keys are presses or relases. Releases are reported as presses. See below for more details.
Platform and pynput version
MacOS, pynput 1.7.7
To Reproduce
Press down shift_l -- will be reported as press
Press down shift_r -- will be reported as press
Release shift_r -- will ALSO be reported as press
Probable Cause
This seems to stem from the way press/release events in macOS are distinguished. In _darwin:316:
# This is a modifier event---excluding caps lock---for which we# must check the current modifier state to determine whether# the key was pressed or releasedflags=CGEventGetFlags(event)
is_press=flags&self._MODIFIER_FLAGS.get(key, 0)
In _MODIFIER_FLAGS, however, keys are mixed because there are no separate flags for each key. In _darwin:248:
This lack of distinct flags in Quartz seems to cause the mixup.
Note, however, that the key from event is actually the correct one, different for shift_l and shift_r. The information is available in the scope, though I don't know if there's a reliability problem there.
The text was updated successfully, but these errors were encountered:
Description
Holding both the left and right keys for a modifier at the same time confuses
pynput
as to whether subsequent events for these keys are presses or relases. Releases are reported as presses. See below for more details.Platform and pynput version
MacOS,
pynput 1.7.7
To Reproduce
shift_l
-- will be reported as pressshift_r
-- will be reported as pressshift_r
-- will ALSO be reported as pressProbable Cause
This seems to stem from the way press/release events in macOS are distinguished. In
_darwin:316
:In
_MODIFIER_FLAGS
, however, keys are mixed because there are no separate flags for each key. In_darwin:248
:This lack of distinct flags in Quartz seems to cause the mixup.
Note, however, that the
key
fromevent
is actually the correct one, different forshift_l
andshift_r
. The information is available in the scope, though I don't know if there's a reliability problem there.The text was updated successfully, but these errors were encountered: