永久解决按输入框焦点和回车键的交互问题

This commit is contained in:
MrZ626
2021-06-08 21:34:07 +08:00
parent 80e95f3e27
commit 67f5ed49ec
4 changed files with 11 additions and 5 deletions

View File

@@ -1093,7 +1093,10 @@ function WIDGET.isFocus(W)
end
function WIDGET.focus(W)
if WIDGET.sel==W then return end
if WIDGET.sel and WIDGET.sel.type=='inputBox'then kb.setTextInput(false)end
if WIDGET.sel and WIDGET.sel.type=='inputBox'then
kb.setTextInput(false)
EDITING=""
end
WIDGET.sel=W
if W and W.type=='inputBox'then
local _,y1=xOy:transformPoint(0,W.y+W.h)
@@ -1103,7 +1106,10 @@ end
function WIDGET.unFocus(force)
local W=WIDGET.sel
if W and(force or not W.keepFocus)then
if W.type=='inputBox'then kb.setTextInput(false)end
if W.type=='inputBox'then
kb.setTextInput(false)
EDITING=""
end
WIDGET.sel=false
end
end