more fixes to X11
[k8lst.git] / samples / termkeySample.st
blob288c57b3aec21ae7bacbf50a162e9c49a45a45c7
1 { System isWindows ifTrue: [ self error: 'windoze eats shit!' ]. }
3 Requires [ termkey ]
6 {[:c |
7    'raw: ' print. System termRaw printNl.
8    System termRaw: true.
9    [ c == $q ] whileFalse: [
10      System isKeyHit
11        ifTrue: [
12          (c := Char input)
13            ifNil: [ c := $q ]
14            ifNotNil: [
15              (c value < 33 or: [ c value = 127]) ifTrue: [ '#' print. c value printNl ] ifFalse: [ '$' print. c printNl ].
16            ].
17        ] ifFalse: [
18          System sleep: 0.1.
19        ].
20    ].
21    System termRaw: false.
22  ] value