Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #55099
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Inconsequent EKEY values in GForth |
| Date | 2017-02-25 16:37 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2017Feb25.173757@mips.complang.tuwien.ac.at> (permalink) |
| References | <59702fa8-dabb-4bb7-bff7-8915faae11a7@googlegroups.com> <o8ie4o$1ck$1@dont-email.me> <e0e5d02b-0d38-49a7-8a11-d1c5615ee689@googlegroups.com> <2017Feb23.172120@mips.complang.tuwien.ac.at> <d72e2a32-0e86-450b-858a-7f93c4c8bb37@googlegroups.com> |
lehs <skydda.barnen@gmail.com> writes:
>From DPANS94 ANS Forth:
>
>"A.10.6.2.1305 EKEY
>EKEY provides a standard word to access a system-dependent set of raw keybo=
>ard events, including events corresponding to members of the standard chara=
>cter set, events corresponding to other members of the implementation-defin=
>ed character set, and keystrokes that do not correspond to members of the c=
>haracter set.
>
>EKEY assumes no particular numerical correspondence between particular even=
>t code values and the values representing standard characters. On some syst=
>ems, this may allow two separate keys that correspond to the same standard =
>character to be distinguished from one another."
>
>I interpret this as that EKEY should return raw code from each key on a key=
>board without special interpretation.
That interpretation does not fit well with K-CTRL-MASK, K-ALT-MASK,
K-SHIFT-MASK. A certain amount of preprocessing is quite useful and
convenient in most cases. If you want less, you can use OS-specific
or hardware-specific ways to get at the events.
In particular, for a Forth system that talks to a terminal (or
terminal emulator), the terminal tends to produce an escape sequence
when you press a cursor or other special key; there is usually no way
to get at the raw keycodes that are internal to the terminal. Also
the terminal or the OS do stuff like flow-control by default (and use
Ctrl-S/Ctrl-Q for that by default), and interpret e.g., Ctrl-C and
Ctrl-Z as signals by default.
It would also not be helpful for EKEY to wait for a keypress on the
console of the machine on which the Forth system runs, because the
user can be at a completely different keyboard; the machine running
the Forth system may actually not have a keyboard at all (e.g., the
Odroid C2 computer I use for Aarch64 development has no keyboard).
For a Forth system that works as an X application (such as xbigforth),
EKEY could provide X events; this at least gives network transparency,
but still has the disadvantage that the application would have to deal
with KeyPress, KeyRelease, MotionNotify and other events; this may be
what the application wants, but relying on that would not be portable
to, e.g., terminal-interfacing systems.
Looking at what Gforth, SwiftForth, and VFX do on Linux, I find that
all three are terminal programs. You cannot EKEY Ctrl-C and Ctrl-Z
with any of them by default; you cannot EKEY Ctrl-S and Ctrl-Q in
Gforth and VFX by default; they serve their function of allowing
flow-control. You can EKEY Ctrl-S and Ctrl-Q in SwiftForth, but OTOH
there is no obvious way to perform flow control in SwiftForth (neither
the ScrollLock nor the Pause key have that effect).
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2016: http://www.euroforth.org/ef16/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-19 02:52 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-21 17:16 -0500
Re: Inconsequent EKEY values in GForth Julian Fondren <julian.fondren@gmail.com> - 2017-02-21 14:26 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-21 23:01 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-21 23:50 -0800
Re: Inconsequent EKEY values in GForth Paul Rubin <no.email@nospam.invalid> - 2017-02-22 00:40 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 00:44 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 00:48 -0800
Re: Inconsequent EKEY values in GForth Paul Rubin <no.email@nospam.invalid> - 2017-02-22 00:51 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 00:54 -0800
Re: Inconsequent EKEY values in GForth minforth@arcor.de - 2017-02-22 02:11 -0800
Re: Inconsequent EKEY values in GForth Paul Rubin <no.email@nospam.invalid> - 2017-02-22 13:46 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-22 17:04 -0500
Re: Inconsequent EKEY values in GForth minforth@arcor.de - 2017-02-23 04:21 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-23 05:51 -0800
Re: Inconsequent EKEY values in GForth Julian Fondren <ayrnieu@gmail.com> - 2017-02-23 06:02 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-23 06:10 -0800
Re: Inconsequent EKEY values in GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-02-23 15:45 +0000
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-23 07:07 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 04:25 -0800
Re: Inconsequent EKEY values in GForth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-02-22 14:22 +0100
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 11:16 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-22 11:44 -0800
Re: Inconsequent EKEY values in GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-02-23 16:21 +0000
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-24 05:04 -0800
Re: Inconsequent EKEY values in GForth "Elizabeth D. Rather" <erather@forth.com> - 2017-02-24 12:27 -1000
Re: Inconsequent EKEY values in GForth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-02-25 12:51 +0100
Re: Inconsequent EKEY values in GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-02-25 16:37 +0000
Re: Inconsequent EKEY values in GForth "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-03-12 04:20 +0000
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-25 05:14 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-25 16:24 -0500
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-25 18:48 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-25 23:41 -0500
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-26 00:48 -0800
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-26 03:13 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-26 15:27 -0500
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-26 23:39 -0800
Re: Inconsequent EKEY values in GForth peter.m.falth@gmail.com - 2017-02-26 14:42 -0800
Re: Inconsequent EKEY values in GForth rickman <gnuarm@gmail.com> - 2017-02-26 18:20 -0500
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-26 23:43 -0800
Re: Inconsequent EKEY values in GForth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-02-27 13:03 +0100
Re: Inconsequent EKEY values in GForth lehs <skydda.barnen@gmail.com> - 2017-02-27 04:22 -0800
Re: Inconsequent EKEY values in GForth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-02-27 13:31 +0100
Re: Inconsequent EKEY values in GForth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-02-23 16:27 +0000
Re: Inconsequent EKEY values in GForth Bernd Paysan <bernd@net2o.de> - 2017-03-12 00:36 +0000
csiph-web