Skip to content

Commit

Permalink
fixed hotkey_common.parent_modifier_string for empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ewerybody committed Mar 14, 2019
1 parent 51e7c69 commit afd9cae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/a2widget/a2hotkey/hotkey_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ def parent_modifier_string(modifier_string):
"""
Gets the modifier string without the side variant l/r.
A hotkey with the modifier LWin+J would collide with Win+J.
As a hotkey like "LWin+Shift+J" would still collide with "Win+Shift+J".
This turns a given string like 'LWin+Shift' to 'Win+Shift'.
:param str modifier_string: Hotkey modifier string with Ls or Rs.
:rtype: str
"""
if not modifier_string:
return []

modifiers = modifier_string.split('+')
for i, part in enumerate(modifiers):
if part[0].lower() in 'lr':
Expand Down

0 comments on commit afd9cae

Please sign in to comment.