EKEY in gforth for linux? 
Author Message
 EKEY in gforth for linux?

        Working on my effort to build an ekey training system for BMW,
to provide support for a small handful of special keys, I found that I
couldn't find EKEY.  Rummaging further, I found that page and at-xy
only existed courtesy of vt100.fs.

        Has anyone done an EKEY for gforth, so I can play with this in
gforth first?  I'll eventually play around with it in another forth or
two, but I'll mostly be using it myself in gforth.



Fri, 08 Feb 2002 03:00:00 GMT  
 EKEY in gforth for linux?


Quote:
>    Working on my effort to build an ekey training system for BMW,
> to provide support for a small handful of special keys, I found that I
> couldn't find EKEY.  Rummaging further, I found that page and at-xy
> only existed courtesy of vt100.fs.

>    Has anyone done an EKEY for gforth, so I can play with this in
> gforth first?  I'll eventually play around with it in another forth or
> two, but I'll mostly be using it myself in gforth.

A very cheap version:

: ekey key ;
: ekey? key? ;
: ekey>char ;

The reason that a real ekey does not exist is that nobody has
implemented it.

The difficulty I saw in the implementation was that I thought that we
should implement it using lower-level services than KEY, and these are
not available in a portable way in C; worse, sometimes they are not
available at all; e.g., AFAIK on Unix KEY-style terminal access is the
lowest level available everywhere.

However, your mentioning of vt100.fs inspired the idea that EKEY could
be implemented based on KEY and KEY? by translating VT100 escape
sequences to EKEY events.  Maybe someone will get around to
implementing it someday.

- anton
--
M. Anton Ertl                    Some things have to be seen to be believed

http://www.complang.tuwien.ac.at/anton/home.html



Wed, 13 Feb 2002 03:00:00 GMT  
 EKEY in gforth for linux?

Quote:

>>        Has anyone done an EKEY for gforth, so I can play with this in
>> gforth first?  I'll eventually play around with it in another forth or
>> two, but I'll mostly be using it myself in gforth.

>A very cheap version:

>: ekey key ;
>: ekey? key? ;
>: ekey>char ;

>The reason that a real ekey does not exist is that nobody has
>implemented it.

>The difficulty I saw in the implementation was that I thought that we
>should implement it using lower-level services than KEY, and these are
>not available in a portable way in C; worse, sometimes they are not
>available at all; e.g., AFAIK on Unix KEY-style terminal access is the
>lowest level available everywhere.

>However, your mentioning of vt100.fs inspired the idea that EKEY could
>be implemented based on KEY and KEY? by translating VT100 escape
>sequences to EKEY events.  Maybe someone will get around to
>implementing it someday.

        Yeah, I guess I will, sometime this year at any rate.  I have
to see how well ekey escape sequences pack by simple shifting: if it
fits 31 bits, I was planning to just shift and NEGATE, which makes
EKEY>CHAR easy.  Unpacking would be left as an exercise for the
reader: I just need it to get cursor keys, special keys, and ALT-keys.

I think a cheap EKEY>CHAR should be

: EKEY>CHAR ( c -- c TRUE ) TRUE ;

but that's off the top of my head: I could be wrong about that.

(
----------
Virtually,

Bruce McFarling, Newcastle,

)



Thu, 14 Feb 2002 03:00:00 GMT  
 EKEY in gforth for linux?


Quote:


> >However, your mentioning of vt100.fs inspired the idea that EKEY could
> >be implemented based on KEY and KEY? by translating VT100 escape
> >sequences to EKEY events.  Maybe someone will get around to
> >implementing it someday.

>    Yeah, I guess I will, sometime this year at any rate.

I have already done it.  You can find the present result at
http://www.complang.tuwien.ac.at/anton/tmp/ekey.fs.

I don't know how well the escape sequences found on my xterm work
elsewhere, so let me know if you have any problems.

Quote:
> I think a cheap EKEY>CHAR should be

> : EKEY>CHAR ( c -- c TRUE ) TRUE ;

> but that's off the top of my head: I could be wrong about that.

You are right.

- anton
--
M. Anton Ertl                    Some things have to be seen to be believed

http://www.complang.tuwien.ac.at/anton/home.html



Thu, 14 Feb 2002 03:00:00 GMT  
 EKEY in gforth for linux?

Quote:





>> >However, your mentioning of vt100.fs inspired the idea that EKEY could
>> >be implemented based on KEY and KEY? by translating VT100 escape
>> >sequences to EKEY events.  Maybe someone will get around to
>> >implementing it someday.

>>        Yeah, I guess I will, sometime this year at any rate.

>I have already done it.  You can find the present result at
> http://www.*-*-*.com/

>I don't know how well the escape sequences found on my xterm work
>elsewhere, so let me know if you have any problems.

        Aha.  The approach I was going to do was simpler, as a way of
generating opaque tokens, but not as simple to reverse.

        I would note my idea of negating the events as opposed to the
characters would normally make it more transparent for unicode, since
unicode characters have the six{*filter*}th bit clear.  But that's in term
of a generic VT-100 -> ekey definition; for gforth itself that's not
an issue at present.

(
----------
Virtually,

Bruce McFarling, Newcastle,

)



Thu, 14 Feb 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. EKEY in gforth in DOS

2. KEY , EKEY , AND EKEY>CHAR

3. GForth on Linux, such as Knoppix

4. Gforth 0.50 on Linux

5. Gforth and Linux-2.4.0

6. Tethered Forth under Linux/Gforth

7. Gforth available, Linux included

8. Problems with gforth / linux tar

9. BUG IN GFORTH FOR LINUX?

10. fun with gforth and Linux

11. IDLE-EKEY?

12. KEY and EKEY

 

 
Powered by phpBB® Forum Software