fix(installer): 更新安装器版本至1.0.3 Beta 7

refactor(appgui_demo): 使用安全的事件拉取函数替换os.pullEvent
This commit is contained in:
2025-09-14 22:21:14 +08:00
parent 9f0b5c4156
commit b1e7f6c8d3
2 changed files with 19 additions and 6 deletions

View File

@@ -20,8 +20,12 @@ print("The bottom bar shows the status information.")
print() print()
print("Press any key to see custom colors...") print("Press any key to see custom colors...")
-- Wait for a key press -- Wait for a key press using a safe event pulling function
os.pullEvent("key") local pullEventFunc = os.pullEvent or os.pullEventRaw
if not pullEventFunc then
error("No valid event pulling function found")
end
local event, key = table.unpack({pullEventFunc("key")})
-- Clear the screen and redraw with custom colors -- Clear the screen and redraw with custom colors
term.clear() term.clear()
@@ -35,8 +39,12 @@ print("Top bar: Yellow text on Red background")
print() print()
print("Press any key to continue...") print("Press any key to continue...")
-- Wait for a key press -- Wait for a key press using a safe event pulling function
os.pullEvent("key") local pullEventFunc = os.pullEvent or os.pullEventRaw
if not pullEventFunc then
error("No valid event pulling function found")
end
local event, key = table.unpack({pullEventFunc("key")})
-- Clear the screen and draw both top and bottom bars -- Clear the screen and draw both top and bottom bars
term.clear() term.clear()
@@ -53,7 +61,12 @@ print("Press Q to exit this demo.")
-- Main loop to handle key presses -- Main loop to handle key presses
while true do while true do
local event, key = os.pullEvent("key") -- Use a safe event pulling function
local pullEventFunc = os.pullEvent or os.pullEventRaw
if not pullEventFunc then
error("No valid event pulling function found")
end
local event, key = table.unpack({pullEventFunc("key")})
if key == 16 then -- Q key if key == 16 then -- Q key
break break
end end

View File

@@ -1,5 +1,5 @@
-- LeonOS installer -- LeonOS installer
local INSTALLER_VERSION = "1.0.3 Beta 6" local INSTALLER_VERSION = "1.0.3 Beta 7"
local DEFAULT_ROM_DIR = "/leonos" local DEFAULT_ROM_DIR = "/leonos"
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...") print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")