2019-10-13 19:33:14 +00:00
|
|
|
sub init()
|
2019-10-14 16:56:22 +00:00
|
|
|
m.top.observeField("buttonSelected", handle_button)
|
2019-10-13 19:33:14 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
function onKeyEvent(key as string, press as boolean) as boolean
|
|
|
|
if key = "OK"
|
2019-10-14 16:56:22 +00:00
|
|
|
m.top.buttonSelected = 0
|
|
|
|
handle_button()
|
2019-10-13 19:33:14 +00:00
|
|
|
return true
|
|
|
|
end if
|
|
|
|
|
|
|
|
return false
|
|
|
|
end function
|
2019-10-14 16:56:22 +00:00
|
|
|
|
|
|
|
function handle_button()
|
|
|
|
' We just toggle the close state, so subsequent touches don't do anything funny
|
|
|
|
m.top.close = true
|
|
|
|
m.top.close = false
|
|
|
|
end function
|