From 15e4f332edaa6a3dcd286275bf9de9549cad7019 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 6 Feb 2021 23:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=85=A5=E6=A1=86?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E5=AD=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 0bbc73b7..54a77e20 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -761,10 +761,11 @@ function inputBox:keypress(k) local t=self.value if #t>0 and EDITING==""then if k=="backspace"then - while t:byte(#t)>=128 and t:byte(#t)<192 do - t=sub(t,1,-2) + local p=#t + while t:byte(p)>=128 and t:byte(p)<192 do + p=p-1 end - t=sub(t,1,-2) + t=sub(t,1,p-1) SFX.play("lock") elseif k=="delete"then t=""