[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Re: Using Keyboardon instead of Readchar



Yehuda Katz wrote:
> 
> 
> 
> What I was trying is to run a short program that reports the ascii value
> of any pressed key. My intention was to hit key after key, in a loop,
> until HALTed. This was my intended program:
> 
>         to main
>         check rc
>         end
> 
>         to check :char
>         pr ascii :char
>         check rc
>         end
> 

A perfect! example for using the event driven keyboard.

to main
keyboardon [(print keyboardvalue "= char keyboardvalue)]
setfocus [MSWLogo Screen] ; Focus must be on the graphics screen
Print [Hit Any Key]
end

Note, there is no need to HALT it because it's not
running unless you hit a key. MSWLogo is completely
idle unless your typing keys with the focus on the
graphics window. MSWLogo can now do other event driven
things like mouse events etc.

readchar is based on the I/O subsystem of a 20 year
old PDP-11. MSWLogo's KEYBOARDON is based on how Windows
natively handles the keyboard. Emulating the paste only
delays one from thinking how things are done in the future.

> I thank you for your help.
> 
> [[Yehuda]]

-- 
===============================================================
George Mills
email: mills@softronix.com
http://www.softronix.com
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home