Skip to content

Commit

Permalink
🐛 Fix swiftkey-specific behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
astariul committed May 21, 2024
1 parent 1a624df commit 5f07396
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kebbie/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ def type_characters(self, characters: str): # noqa: C901
if self.kb_is_upper:
# If the keyboard is in uppercase mode, change it to lowercase
self._tap(self.layout["uppercase"]["shift"])
if self.keyboard == SWIFTKEY:
# Swiftkey needs double tap, otherwise we are capslocking
self._tap(self.layout["uppercase"]["shift"])
self._tap(self.layout["lowercase"][c])
elif c in self.layout["uppercase"]:
# The character is an uppercase character
Expand All @@ -541,9 +544,9 @@ def type_characters(self, characters: str): # noqa: C901
self._tap(self.layout["lowercase"]["numbers"])
self._tap(self.layout["numbers"][c])

if c != "'" or self.keyboard == GBOARD:
if c != "'" or self.keyboard in [GBOARD, SWIFTKEY]:
# For some reason, when `'` is typed, the keyboard automatically goes back
# to lowercase, so no need to re-tap the button (unless the keyboard is GBoard).
# to lowercase, so no need to re-tap the button (unless the keyboard is GBoard / Swiftkey).
# In all other cases, switch back to letters keyboard
self._tap(self.layout["numbers"]["letters"])
else:
Expand Down

0 comments on commit 5f07396

Please sign in to comment.