修复文本框输入时退格键的异常行为
This commit is contained in:
@@ -748,7 +748,7 @@ function textBox:press()
|
|||||||
end
|
end
|
||||||
function textBox:keypress(k)
|
function textBox:keypress(k)
|
||||||
local t=self.value
|
local t=self.value
|
||||||
if #t==0 then return end
|
if #t>0 and EDITING==""then
|
||||||
if k=="backspace"then
|
if k=="backspace"then
|
||||||
while t:byte(#t)>=128 and t:byte(#t)<192 do
|
while t:byte(#t)>=128 and t:byte(#t)<192 do
|
||||||
t=sub(t,1,-2)
|
t=sub(t,1,-2)
|
||||||
@@ -761,6 +761,7 @@ function textBox:keypress(k)
|
|||||||
end
|
end
|
||||||
self.value=t
|
self.value=t
|
||||||
end
|
end
|
||||||
|
end
|
||||||
function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide
|
function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide
|
||||||
local _={
|
local _={
|
||||||
name= D.name,
|
name= D.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user