mirror of
https://github.com/kepler155c/opus
synced 2025-01-11 16:20:26 +00:00
kiosk mode
This commit is contained in:
parent
4977ea94d7
commit
f0a65d87ce
1
startup
1
startup
@ -7,6 +7,7 @@ local bootOptions = {
|
||||
{ prompt = os.version() },
|
||||
{ prompt = 'Opus' , args = { '/sys/boot/opus.boot' } },
|
||||
{ prompt = 'Opus Shell' , args = { '/sys/boot/opus.boot', 'sys/apps/shell' } },
|
||||
{ prompt = 'Opus Kiosk' , args = { '/sys/boot/kiosk.boot' } },
|
||||
}
|
||||
local bootOption = 2
|
||||
if settings then
|
||||
|
@ -97,10 +97,10 @@ function Manager:init()
|
||||
end,
|
||||
|
||||
monitor_touch = function(_, side, x, y)
|
||||
Input:translate('mouse_click', 1, x, y)
|
||||
local ie = Input:translate('mouse_up', 1, x, y)
|
||||
local dev = self.devices[side]
|
||||
if dev and dev.currentPage then
|
||||
Input:translate('mouse_click', 1, x, y)
|
||||
local ie = Input:translate('mouse_up', 1, x, y)
|
||||
self:click(dev.currentPage, ie.code, 1, x, y)
|
||||
end
|
||||
end,
|
||||
|
34
sys/boot/kiosk.boot
Normal file
34
sys/boot/kiosk.boot
Normal file
@ -0,0 +1,34 @@
|
||||
local os = _G.os
|
||||
local parallel = _G.parallel
|
||||
local peripheral = _G.peripheral
|
||||
local settings = _G.settings
|
||||
local term = _G.term
|
||||
|
||||
|
||||
local mon = peripheral.find('monitor')
|
||||
if mon then
|
||||
term.redirect(mon)
|
||||
if not settings.get('opus.kiosk.textscale') then
|
||||
settings.set('opus.kiosk.textscale', .5)
|
||||
end
|
||||
mon.setTextScale(settings.get('opus.kiosk.textscale') or .5)
|
||||
|
||||
parallel.waitForAny(
|
||||
function()
|
||||
os.run(_ENV, '/sys/boot/opus.boot')
|
||||
end,
|
||||
|
||||
function()
|
||||
while true do
|
||||
local event, _, x, y = os.pullEventRaw('monitor_touch')
|
||||
|
||||
if event == 'monitor_touch' then
|
||||
os.queueEvent('mouse_click', 1, x, y)
|
||||
os.queueEvent('mouse_up', 1, x, y)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
else
|
||||
os.run(_ENV, '/sys/boot/opus.boot')
|
||||
end
|
Loading…
Reference in New Issue
Block a user