aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo/ex1.erl
blob: 8606ac92d23dc0563ef427aa5204847e5ee423ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%%%----------------------------------------------------------------------
%%% File    : ex1.erl
%%% Author  : Claes Wikstrom <klacke@kaja.hemma.net>
%%% Purpose :
%%% Created : 22 Nov 2000 by Claes Wikstrom <klacke@kaja.hemma.net>
%%%----------------------------------------------------------------------

-module(ex1).
-author('klacke@kaja.hemma.net').

-compile(export_all).

run() ->
    slang:init_tty(7,0,1),
    slang:set_abort_signal(null),
    loop().

loop() ->
    io:format("Press any key to quit press ctl_G ",[]),
    X = slang:getkey(),
    io:format("Got key ~p~n", [X]),
    case X of
	7 ->
	    slang:reset_tty(),
	    halt(),
	    7;
	_ ->
	    loop()
    end.