Fix supression ...

This commit is contained in:
Tipragot 2023-11-04 16:41:20 +01:00
parent 67abb5dd07
commit 28b78774d2

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 (