summaryrefslogtreecommitdiffstats
path: root/share/examples/bootforth/menu.4th
diff options
context:
space:
mode:
authorabial <abial@FreeBSD.org>1998-12-31 14:06:30 +0000
committerabial <abial@FreeBSD.org>1998-12-31 14:06:30 +0000
commit38242090af4e4abbf472c304458fed9f3faf7781 (patch)
tree27a5a6cb3b50f81d0f479d98cea04e17f6e49054 /share/examples/bootforth/menu.4th
parent25196ce9dd89d25811f8f176b8f7c15a18dca24a (diff)
downloadFreeBSD-src-38242090af4e4abbf472c304458fed9f3faf7781.zip
FreeBSD-src-38242090af4e4abbf472c304458fed9f3faf7781.tar.gz
Add timeout to boot menu.
Submitted by: W Gerald Hicks <wghicks@bellsouth.net>
Diffstat (limited to 'share/examples/bootforth/menu.4th')
-rw-r--r--share/examples/bootforth/menu.4th26
1 files changed, 24 insertions, 2 deletions
diff --git a/share/examples/bootforth/menu.4th b/share/examples/bootforth/menu.4th
index ad98029..06493c5 100644
--- a/share/examples/bootforth/menu.4th
+++ b/share/examples/bootforth/menu.4th
@@ -1,7 +1,7 @@
\ Simple greeting screen, presenting basic options.
\ XXX This is far too trivial - I don't have time now to think
\ XXX about something more fancy... :-/
-\ $Id$
+\ $Id: menu.4th,v 1.1 1998/12/22 12:15:45 abial Exp $
: title
f_single
@@ -22,11 +22,33 @@
me
;
+: tkey ( d -- flag | char )
+ seconds +
+ begin 1 while
+ dup seconds u< if
+ drop
+ -1
+ exit
+ then
+ key? if
+ drop
+ key
+ exit
+ then
+ repeat
+;
+
: prompt
14 fg
20 11 at-xy
." Enter your option (1,2,3): "
- key
+ 10 tkey
+ dup 32 = if
+ drop key
+ then
+ dup 0< if
+ drop 49
+ then
dup emit
me
;
OpenPOWER on IntegriCloud