diff --git a/parts/data.lua b/parts/data.lua index 7881c920..1a3e1ef4 100644 --- a/parts/data.lua +++ b/parts/data.lua @@ -114,9 +114,7 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board local _,__ --Decode - if not str:find("%S")then return end - str=str:sub((str:find("%S"))):reverse() - str=str:sub((str:find("%S"))):reverse() + str=STRING.trim(str) _,str=pcall(data.decode,'string','base64',str) if not _ then return end _,str=pcall(data.decompress,'string','zlib',str) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 5ba479ac..97efbaf9 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -92,7 +92,7 @@ function scene.keyDown(key) TASK.new(function()YIELD()WIDGET.sel=inputBox end) enableTextInput() else - local mes=inputBox:getText():match"%S+" + local mes=STRING.trim(inputBox:getText()) if mes and #mes>0 then NET.sendMessage(mes) inputBox:clear() @@ -133,12 +133,7 @@ function scene.keyUp(key) end function scene.gamepadDown(key) if key=="back"then - if TIME()-lastBackTime<1 then - NET.signal_quit() - else - lastBackTime=TIME() - LOG.print(text.sureQuit,COLOR.O) - end + scene.keyDown("escape") else local k=keyMap.joystick[key] if k and k>0 then