添加这段代码后,我失去了游戏的声音。即使是音量控制按钮在播放时也不起作用。需要尽快解决。谢谢。
Runtime:addEventListener( "key", onKeyEvent )
function onKeyEvent( event )
if (event.phase == "up" and event.keyName=="back") then
goToTheMenu()
end
end
将您的功能更改为:
function onKeyEvent( event )
local keyname = event.keyName;
if (event.phase == "up" and (event.keyName=="back" or event.keyName=="menu" or event.keyName == "home" )) then
if keyname == "menu" or keyname == "back" or keyname == "home" then
goToMenu()
return true
end
end
return false
end