Merge pull request 'Fix supression ...' (#61) from typing into main

Reviewed-on: #61
This commit is contained in:
CoCo_Sol 2023-11-04 18:36:29 +00:00 committed by Gitea
commit 06cc7bbca3
No known key found for this signature in database

View file

@ -30,9 +30,11 @@ def __update(world: World):
writing = entity[Writing] writing = entity[Writing]
text = entity[Text] text = entity[Text]
for key in pressed: for key in pressed:
if key == "backspace": if key == "backspace" and text.text != writing.base_text:
text.text = text.text[:-1] text.text = text.text[:-1]
world.new_entity().set(CLICK_SOUND) world.new_entity().set(CLICK_SOUND)
if text.text == "":
text.text = writing.base_text
if key.startswith("["): # pavé numerique if key.startswith("["): # pavé numerique
key = key[1] key = key[1]
if key in writing.accepted_chars and ( if key in writing.accepted_chars and (