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
I just notice that "key" attribute of KeyEvent has changed when modifier keys are activated (e.g. previously "up", now "ctrl+up"). I have updated my code but i report that "key" attribute is sometimes wrong. When Alt or Ctrl are pressed, "key" attribute is respectively "alt" and "control" but, when Alt or Ctrl are released, "key" is "alt+alt" and "ctrl+control". I suggest to add a test before loop which prefixes "key" with modifier keys.
def_get_key(self, evt):
keyval=evt.m_keyCodeifkeyvalinself.keyvald:
key=self.keyvald[keyval]
elifkeyval<256:
key=chr(keyval)
# wx always returns an uppercase, so make it lowercase if the shift# key is not depressed (NOTE: this will not handle Caps Lock)ifnotevt.ShiftDown():
key=key.lower()
else:
key=None# Adds a test to prevent this issue.ifkeynotin ("alt", "control"):
formeth, prefixin (
[evt.AltDown, 'alt'],
[evt.ControlDown, 'ctrl'], ):
ifmeth():
key='{0}+{1}'.format(prefix, key)
returnkey
The text was updated successfully, but these errors were encountered:
@YannGoudard Is this still an issue on master (I don't have wx on this machine to test)? There has been a bunch of work recently improving the modifier key handling of several of the backends.
I just notice that "key" attribute of KeyEvent has changed when modifier keys are activated (e.g. previously "up", now "ctrl+up"). I have updated my code but i report that "key" attribute is sometimes wrong. When Alt or Ctrl are pressed, "key" attribute is respectively "alt" and "control" but, when Alt or Ctrl are released, "key" is "alt+alt" and "ctrl+control". I suggest to add a test before loop which prefixes "key" with modifier keys.
The text was updated successfully, but these errors were encountered: