Skip to content

Commit 82259a1

Browse files
committed
LilyGo T-Deck multi-key conversion bug fix
1 parent 788880c commit 82259a1

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

PyDOS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def PyDOS():
6767
global envVars
6868
if "envVars" not in globals().keys():
6969
envVars = {}
70-
_VER = "1.38"
70+
_VER = "1.39"
7171
prmpVals = ['>','(',')','&','|','\x1b','\b','<','=',' ',_VER,'\n','$','']
7272

7373
print("Starting Py-DOS...")

cpython/kbdFeatherWing/keys.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ echo _# ^
1414
echo _/ \
1515
echo -/ %%
1616
echo Speaker Key (left of enter) $
17+
echo Track ball up up arrow
18+
echo Track ball down down arrow
19+
echo Track ball left left arrow
20+
echo Track ball right right arrow
1721
echo .
1822
goto done
1923

cpython/lib/optional/pydos_ui_lilygokbd.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,22 @@ def input(disp_text=None):
203203
# Convert two character sequences into missing keyboard keys
204204
# '_-' -> '=' '(+' -> '[' '+)' -> ']'
205205
bld_done = False
206-
bcindx = bld_chr2.find(keys[editCol-1:editCol])
207-
if bld_chr1.find(keys[editCol-1:editCol]) != -1 and not bld_started and arrow == "":
208-
bld_started = True
209-
elif keys[editCol-2:editCol] == bld_chr1[bcindx]+bld_chr2[bcindx] and bld_started:
210-
bld_started = False
211-
keys = keys[:editCol-2]+bld_chr[bcindx]+keys[editCol:]
212-
print('\x08'+keys[editCol-2:]+' '+('\x08'*(len(keys[editCol:])+(1 if onLast else 2))),end="")
213-
editCol -= 1
214-
bld_done = True
215-
elif bld_chr1.find(keys[editCol-1:editCol]) != -1 and arrow == "":
206+
if bld_started:
207+
208+
bcindx = bld_chr2.find(keys[editCol-1:editCol])
209+
nextbc = 0
210+
while nextbc != -1 and bld_started:
211+
if keys[editCol-2:editCol] == bld_chr1[bcindx]+bld_chr2[bcindx]:
212+
bld_started = False
213+
bld_done = True
214+
keys = keys[:editCol-2]+bld_chr[bcindx]+keys[editCol:]
215+
print('\x08'+keys[editCol-2:]+' '+('\x08'*(len(keys[editCol:])+(1 if onLast else 2))),end="")
216+
editCol -= 1
217+
else:
218+
nextbc = bld_chr2[bcindx+1:].find(keys[editCol-1:editCol])
219+
bcindx = bcindx + nextbc + 1
220+
221+
if bld_chr1.find(keys[editCol-1:editCol]) != -1 and arrow == "" and not bld_done:
216222
bld_started = True
217223
else:
218224
bld_started = False

0 commit comments

Comments
 (0)