修改系统进入文本输入状态时机
This commit is contained in:
@@ -590,6 +590,9 @@ local textBox={
|
|||||||
}
|
}
|
||||||
function textBox:reset()
|
function textBox:reset()
|
||||||
self.ATV=0
|
self.ATV=0
|
||||||
|
if not MOBILE then
|
||||||
|
kb.setTextInput(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function textBox:isAbove(x,y)
|
function textBox:isAbove(x,y)
|
||||||
return
|
return
|
||||||
@@ -665,13 +668,14 @@ end
|
|||||||
WIDGET.active={}--Table contains all active widgets
|
WIDGET.active={}--Table contains all active widgets
|
||||||
WIDGET.sel=nil--Selected widget
|
WIDGET.sel=nil--Selected widget
|
||||||
function WIDGET.set(L)
|
function WIDGET.set(L)
|
||||||
|
kb.setTextInput(false)
|
||||||
WIDGET.sel=nil
|
WIDGET.sel=nil
|
||||||
WIDGET.active=L or{}
|
WIDGET.active=L or{}
|
||||||
|
|
||||||
--Reset all widgets
|
--Reset all widgets
|
||||||
if L then
|
if L then
|
||||||
for _,W in next,L do
|
for i=1,#L do
|
||||||
if W.reset then W:reset()end
|
L[i]:reset()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -724,7 +728,7 @@ function WIDGET.press(x,y)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif W.type=="textBox"then
|
elseif W.type=="textBox"then
|
||||||
if SYSTEM=="Android"then
|
if MOBILE then
|
||||||
local _,y=xOy:transformPoint(0,W.y+W.h)
|
local _,y=xOy:transformPoint(0,W.y+W.h)
|
||||||
kb.setTextInput(true,0,y,1,1)
|
kb.setTextInput(true,0,y,1,1)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
local rnd=math.random
|
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 function BACK()SCN.back()end
|
||||||
local virtualkeySet={
|
local virtualkeySet={
|
||||||
{
|
{
|
||||||
|
|||||||
6
main.lua
6
main.lua
@@ -12,6 +12,7 @@
|
|||||||
NULL=function()end
|
NULL=function()end
|
||||||
DBP=print--use this if need debugging print
|
DBP=print--use this if need debugging print
|
||||||
SYSTEM=love.system.getOS()
|
SYSTEM=love.system.getOS()
|
||||||
|
MOBILE=SYSTEM=="Android"or SYSTEM=="iOS"
|
||||||
MARKING=true
|
MARKING=true
|
||||||
LOADED=false
|
LOADED=false
|
||||||
NOGAME=false
|
NOGAME=false
|
||||||
@@ -20,6 +21,7 @@ LOGIN=false
|
|||||||
--Global Setting & Vars
|
--Global Setting & Vars
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
love.keyboard.setTextInput(false)
|
||||||
love.mouse.setVisible(false)
|
love.mouse.setVisible(false)
|
||||||
|
|
||||||
SCR={
|
SCR={
|
||||||
@@ -132,7 +134,7 @@ if fs.getInfo("settings.dat")then
|
|||||||
FILE.loadSetting()
|
FILE.loadSetting()
|
||||||
else
|
else
|
||||||
-- firstRun=true
|
-- firstRun=true
|
||||||
if SYSTEM=="Android"or SYSTEM=="iOS" then
|
if MOBILE then
|
||||||
SETTING.VKSwitch=true
|
SETTING.VKSwitch=true
|
||||||
SETTING.swap=false
|
SETTING.swap=false
|
||||||
SETTING.vib=2
|
SETTING.vib=2
|
||||||
@@ -210,7 +212,7 @@ do
|
|||||||
FILE.saveData()
|
FILE.saveData()
|
||||||
FILE.saveSetting()
|
FILE.saveSetting()
|
||||||
end
|
end
|
||||||
if SYSTEM=="Android"and not SETTING.fullscreen then
|
if MOBILE and not SETTING.fullscreen then
|
||||||
LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,color.yellow)
|
LOG.print("如果手机上方状态栏不消失,请到设置界面开启全屏",300,color.yellow)
|
||||||
LOG.print("Switch fullscreen on if titleBar don't disappear",300,color.yellow)
|
LOG.print("Switch fullscreen on if titleBar don't disappear",300,color.yellow)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user