修改系统进入文本输入状态时机

This commit is contained in:
MrZ626
2020-10-20 13:41:38 +08:00
parent 8ac1720e9d
commit 1ddea8e2cc
3 changed files with 17 additions and 6 deletions

View File

@@ -590,6 +590,9 @@ local textBox={
}
function textBox:reset()
self.ATV=0
if not MOBILE then
kb.setTextInput(true)
end
end
function textBox:isAbove(x,y)
return
@@ -665,13 +668,14 @@ end
WIDGET.active={}--Table contains all active widgets
WIDGET.sel=nil--Selected widget
function WIDGET.set(L)
kb.setTextInput(false)
WIDGET.sel=nil
WIDGET.active=L or{}
--Reset all widgets
if L then
for _,W in next,L do
if W.reset then W:reset()end
for i=1,#L do
L[i]:reset()
end
end
end
@@ -724,7 +728,7 @@ function WIDGET.press(x,y)
end
end
elseif W.type=="textBox"then
if SYSTEM=="Android"then
if MOBILE then
local _,y=xOy:transformPoint(0,W.y+W.h)
kb.setTextInput(true,0,y,1,1)
end

View File

@@ -1,5 +1,10 @@
local rnd=math.random
local mobileHide=(SYSTEM=="Android"or SYSTEM=="iOS")and function()return true end
local mobileHide,mobileShow
if MOBILE then
function mobileHide()return true end
else
function mobileShow()return true end
end
local function BACK()SCN.back()end
local virtualkeySet={
{

View File

@@ -12,6 +12,7 @@
NULL=function()end
DBP=print--use this if need debugging print
SYSTEM=love.system.getOS()
MOBILE=SYSTEM=="Android"or SYSTEM=="iOS"
MARKING=true
LOADED=false
NOGAME=false
@@ -20,6 +21,7 @@ LOGIN=false
--Global Setting & Vars
math.randomseed(os.time()*626)
love.keyboard.setKeyRepeat(true)
love.keyboard.setTextInput(false)
love.mouse.setVisible(false)
SCR={
@@ -132,7 +134,7 @@ if fs.getInfo("settings.dat")then
FILE.loadSetting()
else
-- firstRun=true
if SYSTEM=="Android"or SYSTEM=="iOS" then
if MOBILE then
SETTING.VKSwitch=true
SETTING.swap=false
SETTING.vib=2
@@ -210,7 +212,7 @@ do
FILE.saveData()
FILE.saveSetting()
end
if SYSTEM=="Android"and not SETTING.fullscreen then
if MOBILE and not SETTING.fullscreen then
LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,color.yellow)
LOG.print("Switch fullscreen on if titleBar don't disappear",300,color.yellow)
end