Skip to content

Commit

Permalink
fix backspace print (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwormhole authored Sep 7, 2024
1 parent 20dba5f commit daa3cee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def on_keybutton_clicked(self, _: Gtk.Button, text: str):
return

cursor_position: int = self.textarea.get_position()
if text == BACKSPACE and cursor_position == 0:
return
if text == BACKSPACE and cursor_position != 0:
buff: Gtk.EntryBuffer = self.textarea.get_buffer()
buff.delete_text(cursor_position - 1, 1)
Expand Down

0 comments on commit daa3cee

Please sign in to comment.