Subject: [clisp-list] raw mode for charactor reading

From: [email-masked]
Date: Thu Jun 27 13:11:05 2002

I'm having dificulty using the raw terminal mode.  I updated to clisp 2.28, then tried:

[1]> (system::terminal-raw *standard-input* t)
NIL
[2]> (system::terminal-raw *standard-input* t)
T
[3]> (defun something-stupid (ch)
  (princ ch)
  (sleep .1)
  (setf tmp (read-char-no-hang))
  (if (null tmp)
      (something-stupid ch)
    (something-stupid tmp)))
SOMETHING-STUPID

[4]> (something-stupid #\a)
aaaaaaaaaaaadfg
            ^hangs as soon as i hit a key,
	then prints all the keys that i've hit as soon as i hit enter.
	I wanted it to print aaaaaaaaaaaadddfffggg, and not even have 
	to hit enter.

My goal here is to check if a key has been hit, without holding up the 
program.  (writing a interactive game in which your racing a clock)

I can't find any further information on termial-raw.  How should i go 
about this?

Corey

---

From: Sam Steingold <[email-masked]>
Date: Thu Jun 27 13:51:05 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] raw mode for charactor reading"
> * Sent on Thu, 27 Jun 2002 15:49:32 -0500
> * Honorable [email-masked] writes:
>

this is an internal function.
do not use it.

see <http://clisp.cons.org/impnotes.html#terminal> or
<http://clisp.cons.org/impnotes/terminal.html>.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
The early bird may get the worm, but the second mouse gets the cheese.

---

From: [email-masked]
Date: Thu Jun 27 23:30:03 2002

> this is an internal function.

Is it possible to read a charactor without waiting for enter to be pressed in clisp?  If so how?  

Corey

p.s. i've tried screen:read-keyboard-char, read-char-no-hang, and others with no luck.

---

From: Arseny Slobodjuck <[email-masked]>
Date: Fri Jun 28 00:03:01 2002

Hi,

Friday, June 28, 2002, 5:08:54 PM, you wrote:

corey> Is it possible to read a charactor without waiting for enter to be pressed in clisp?  If so how?
corey> p.s. i've tried screen:read-keyboard-char, read-char-no-hang, and others with no luck.
On windows I'm using the following

...
  (let ((ch nil))
   (ext:with-keyboard
     (setf ch (read-char ext:*keyboard-input*))
     ...
     (when (eq (system::input-character-key ch) :RIGHT)
          ...)
     ...

I remember it was worked on FreeBSD too.

-- 
Best regards,
 Arseny                            mailto:[email-masked]

---

From: Sam Steingold <[email-masked]>
Date: Fri Jun 28 05:58:02 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] raw mode for charactor reading"
> * Sent on Fri, 28 Jun 2002 02:08:54 -0500
> Is it possible to read a charactor without waiting for enter to be
> pressed in clisp?  

yes it is.

> If so how?

in my previous message I gave you two URLs.
did you read them?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
What garlic is to food, insanity is to art.

---

From: [email-masked]
Date: Thu Jul 4 11:12:05 2002

> in my previous message I gave you two URLs.

No.  I thought they were part of your tagline.  My bad.  I"ve read them now and everythings working great.  I've even gotten sound and color working.  Kinda cheezy ways, but the work:

;sound
(execute "/usr/bin/rplay" "/disks/md0/usr/share/sounds/everybuddy/BuddyArrive.au")

;color (this only works on the linux console)
(defconstant BLACK #\0)
(defconstant RED #\1)
(defconstant GREEN #\2)
(defconstant BROWN #\3)
(defconstant BLUE #\4)
(defconstant PURPLE #\5)
(defconstant TURQUOISE #\6)
(defconstant GREY #\7)
(defconstant WHITE #\8)

(defun set-color (color)
  (princ #\escape)
  (princ #\[)
  (princ #\3)
  (princ color)
  (princ #\m))

(defun set-background-color (color)
  (princ #\escape)
  (princ #\[)
  (princ #\4)
  (princ color)
  (princ #\m))

> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Caffeinated soap. No kidding.
> http://thinkgeek.com/sf
> _______________________________________________
> clisp-list mailing list
> [email-masked]
> https://lists.sourceforge.net/lists/listinfo/clisp-list