Skip to content

Commit

Permalink
Merge pull request #2567 from zaphodikus/main
Browse files Browse the repository at this point in the history
Fix broken unicode len checking in examples/textinput.py
  • Loading branch information
illume committed Oct 9, 2021
2 parents dd96c97 + a13b5cd commit 553a63d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/textinput.py
Expand Up @@ -103,11 +103,8 @@ def main():
_IMETextPos = max(0, _IMETextPos - 1)
elif event.key == pg.K_RIGHT:
_IMETextPos = min(len(_IMEText), _IMETextPos + 1)

elif (
event.key in [pg.K_RETURN, pg.K_KP_ENTER]
and len(event.unicode) == 0
):
# Handle ENTER key
elif event.key in [pg.K_RETURN, pg.K_KP_ENTER]:
# Block if we have no text to append
if len(_IMEText) == 0:
continue
Expand Down

0 comments on commit 553a63d

Please sign in to comment.