hello
how could I trap ctrl+c key to call a word ?
just like
: test
\ some stuff
key
case
81 of dosomething endof
ctrlc of callaword endof
\etc...
;
without breaking forth interpretor execution but really using it as a
key or input flow
currently whatever I tryied yet continues to use ctrl-c as BREAK signal...
It is unbelievable that some one posts this kind of question without mentioning the compiler or operating system.
In article <08895bfe-78fe-486c...@googlegroups.com>,
gobli...@gmail.com <gobli...@gmail.com> wrote:
hello
how could I trap ctrl+c key to call a word ?
just like
: test
\ some stuff
key
case
81 of dosomething endof
ctrlc of callaword endof
\etc...
;
without breaking forth interpretor execution but really using it as a
key or input flow
currently whatever I tryied yet continues to use ctrl-c as BREAK signal...
It is unbelievable that some one posts this kind of question without mentioning the compiler or operating system.
--
Don't praise the day before the evening. One swallow doesn't make spring. You must not say "hey" before you have crossed the bridge. Don't sell the hide of the bear until you shot it. Better one bird in the hand than ten in the air. First gain is a cat spinning. - the Wise from Antrim -
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
It is unbelievable that some one posts this kind of question without mentioning the compiler or operating system.I get the sense that younger people think of GForth like they think of GCC. ie: GForth "is" Forth. What else would you use bro'? :-)
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
It is unbelievable that some one posts this kind of question without
mentioning the compiler or operating system.
I get the sense that younger people think of GForth like they think of GCC. ie: GForth "is" Forth. What else would you use bro'? :-)
Le mercredi 16 août 2023 à 21:22:13 UTC+2, Brian Fox a écrit :
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
Hello,It is unbelievable that some one posts this kind of question without mentioning the compiler or operating system.I get the sense that younger people think of GForth like they think of GCC.
ie: GForth "is" Forth. What else would you use bro'? :-)
On other forum someone give a clue, specific to gforth but might be usable/adaptable to other forth interpretors.
Redefining the "key" word as :
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth interpretor
: key ( -- x ) \ redefine key to manage trap on CTRL+C
['] key catch dup key-ctrl-c-ior = if exit then throw
;
and this does the job.
this was general purpose question, not specific to one or one other forth i= >nterpretor for any operating system ! so of course I could'nt mention a sy= >stem in the question
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
It is unbelievable that some one posts this kind of question without
mentioning the compiler or operating system.
I get the sense that younger people think of GForth like they think of GCC. >ie: GForth "is" Forth. What else would you use bro'? :-)
In article <f72d3dbe-8e0a-441f...@googlegroups.com>,
Brian Fox <bria...@brianfox.ca> wrote:
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
It is unbelievable that some one posts this kind of question without
mentioning the compiler or operating system.
I get the sense that younger people think of GForth like they think of GCC. >ie: GForth "is" Forth. What else would you use bro'? :-)Even if we assume that GForth is so universal,
that doesn't cut it.
The answer is dependant on Gforth under MS-windows,
probably on versions, 0.7.3 and the latest, gforth fast etc.
Le mercredi 16 août 2023 à 21:22:13 UTC+2, Brian Fox a écrit :
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:
Hello,It is unbelievable that some one posts this kind of question without mentioning the compiler or operating system.I get the sense that younger people think of GForth like they think of GCC.
ie: GForth "is" Forth. What else would you use bro'? :-)
On other forum someone give a clue, specific to gforth but might be usable/adaptable to other forth interpretors.
Redefining the "key" word as :
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth interpretor
: key ( -- x ) \ redefine key to manage trap on CTRL+C
['] key catch dup key-ctrl-c-ior = if exit then throw
;
and this does the job.
none albert schrieb am Donnerstag, 17. August 2023 um 12:08:08 UTC+2:
In article <f72d3dbe-8e0a-441f...@googlegroups.com>,
Brian Fox <bria...@brianfox.ca> wrote:
On Wednesday, August 16, 2023 at 2:17:05 PM UTC-4, none albert wrote:Even if we assume that GForth is so universal,
It is unbelievable that some one posts this kind of question without
mentioning the compiler or operating system.
I get the sense that younger people think of GForth like they think of GCC. >>> ie: GForth "is" Forth. What else would you use bro'? :-)
that doesn't cut it.
The answer is dependant on Gforth under MS-windows,
probably on versions, 0.7.3 and the latest, gforth fast etc.
Even on Windoze you can use different terminals instead of the default console. In addition Windows consoles have changed in the past
between different OS generations eg regarding ANSI VT support.
So there is no universal answer to the original question.
On Thursday, August 17, 2023 at 12:30:01=E2=80=AFAM UTC-4, gobli...@gmail.c= >om wrote:...
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth inte= >rpretor=20
: key ( -- x ) \ redefine key to manage trap on CTRL+C=20
['] key catch dup key-ctrl-c-ior =3D if exit then throw=20
;=20
As you may have read here in the other posts, for better or worse, your
code will work on GForth and only on GForth.=20
Something similar may exist in another Forth for the same hardware but
it might use a different name for "key-ctrl-c-ior".
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth interpretor
: key ( -- x ) \ redefine key to manage trap on CTRL+C
['] key catch dup key-ctrl-c-ior = if exit then throw
;
"gobli...@gmail.com" <goblinrieur@gmail.com> writes:
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth >interpretor
: key ( -- x ) \ redefine key to manage trap on CTRL+C
['] key catch dup key-ctrl-c-ior = if exit then throw
;
This produces -28 as result of KEY in case of a Ctrl-C. The value 3
(what you get if Ctrl-C is not converted into a signal) would be more >appropriate. I.e.:
-28 constant key-ctrl-c-ior \ trap control+c key code for the gforth interpretor
: key ( -- x ) \ redefine key to manage trap on CTRL+C
['] key catch dup key-ctrl-c-ior = if drop 3 exit then throw ;
This works on Gforth without having to reconfigure the environment to >actually pass through the Ctrl-C as key, but testing it on sd64,
vfx64, iforth, lxf, it does not work on any other system (only iforth >converts the signal into a Forth exception, but it does not throw
-28).
- anton
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
So there is no universal answer to the original question.I had good things to say about the ATARI 800 when I
dxforth <dxforth@gmail.com> writes:
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
key . 3 ok
key . 19 ok
key . 17 ok
key . 26 ok
If Gforth does not respond to you pressing these keys, it's because
the environment does not pass them to Gforth.
As for "Gforth Win", using Gforth is certainly a win; or did you mean something else?
dxforth <dxforth@gmail.com> writes:
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
key . 3 ok
key . 19 ok
key . 17 ok
key . 26 ok
If Gforth does not respond to you pressing these keys, it's because
the environment does not pass them to Gforth.
As for "Gforth Win", using Gforth is certainly a win; or did you mean
something else?
Clearly it's a loss for Gforth application writers. If DOSBOX can
extract keystrokes from the Windows environment, so can others.
In article <ubpbgq$jjn1$1@dont-email.me>, dxforth <dxforth@gmail.com> wrote:
On 19/08/2023 1:19 am, Anton Ertl wrote:
dxforth <dxforth@gmail.com> writes:
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
key . 3 ok
key . 19 ok
key . 17 ok
key . 26 ok
If Gforth does not respond to you pressing these keys, it's because
the environment does not pass them to Gforth.
As for "Gforth Win", using Gforth is certainly a win; or did you mean
something else?
Clearly it's a loss for Gforth application writers. If DOSBOX can
extract keystrokes from the Windows environment, so can others.
I don't think so. DOSBOX is a fairly primitive emulator, for a
fairly primitive system. But it is an *emulator* of an *environment*.
I was impressed that a Forth editor that writes directly in the
screen memory $B000 works in DOSBOX.
...
As Anton Ertl has pointed out the manipulations going on before
keys arriving into Forth are extensive. Always realize that
that requires adaptation to programs.
In article <ubpbgq$jjn1$1@dont-email.me>, dxforth <dxforth@gmail.com> wrote:
On 19/08/2023 1:19 am, Anton Ertl wrote:
dxforth <dxforth@gmail.com> writes:
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
key . 3 ok
key . 19 ok
key . 17 ok
key . 26 ok
If Gforth does not respond to you pressing these keys, it's because
the environment does not pass them to Gforth.
As for "Gforth Win", using Gforth is certainly a win; or did you mean
something else?
Clearly it's a loss for Gforth application writers. If DOSBOX can
extract keystrokes from the Windows environment, so can others.
I don't think so. DOSBOX is a fairly primitive emulator, for a
fairly primitive system. But it is an *emulator* of an *environment*.
I was impressed that a Forth editor that writes directly in the
screen memory $B000 works in DOSBOX.
...
As Anton Ertl has pointed out the manipulations going on before
keys arriving into Forth are extensive. Always realize that
that requires adaptation to programs.
Win32Forth, SwiftForth, NT/Forth all work with the aforementioned keys >without issue. Quality of implementation? VFX handles them with the >exception of crtl-c.
In article <ubqchf$ptjj$1@dont-email.me>, dxforth <dxforth@gmail.com> wrote:
On 19/08/2023 6:40 pm, albert wrote:
In article <ubpbgq$jjn1$1@dont-email.me>, dxforth <dxforth@gmail.com> wrote:
On 19/08/2023 1:19 am, Anton Ertl wrote:
dxforth <dxforth@gmail.com> writes:
In addition to the ctrl-c issue, Gforth Win
doesn't respond to crtl-s, ctrl-q, ctrl-z.
key . 3 ok
key . 19 ok
key . 17 ok
key . 26 ok
If Gforth does not respond to you pressing these keys, it's because
the environment does not pass them to Gforth.
As for "Gforth Win", using Gforth is certainly a win; or did you mean >>>>> something else?
Clearly it's a loss for Gforth application writers. If DOSBOX can
extract keystrokes from the Windows environment, so can others.
I don't think so. DOSBOX is a fairly primitive emulator, for a
fairly primitive system. But it is an *emulator* of an *environment*.
I was impressed that a Forth editor that writes directly in the
screen memory $B000 works in DOSBOX.
...
As Anton Ertl has pointed out the manipulations going on before
keys arriving into Forth are extensive. Always realize that
that requires adaptation to programs.
Win32Forth, SwiftForth, NT/Forth all work with the aforementioned keys
without issue. Quality of implementation? VFX handles them with the
exception of crtl-c.
What do you mean? The function of ^C is to break off the program.
What do you mean? The function of ^C is to break off the program.
The function of ^C is whatever the application determines it to be.
It would be a poor outcome if a WordStar user pressed ^C and the
program aborted.
On 8/19/23 9:59 AM, dxforth wrote:
Only sort of true.What do you mean? The function of ^C is to break off the program.
The function of ^C is whatever the application determines it to be.
It would be a poor outcome if a WordStar user pressed ^C and the
program aborted.
Going back to CP/M days, there were two type of console I/O available.
The usual route was to use a BDOS call and in this case the I/O was "cooked" in that various things like ^C were handled. With no interaction with the application.
You could bypass the things that the BDOS did to the console I/O and use a direct BIOS call. This prevented the BDOS from ever seeing the characters. Mostly.
As I found when using CP/M-68K which is variant of CP/M-2.2, calling the BDOS console output function will result in the BDOS checking for an input character. Just in case the user typed XOFF. So if you want to use a BIOS call for input to avoid BDOSprocessing, you also have to use the BIOS output call.
hello
how could I trap ctrl+c key to call a word ?
just like
: test
\ some stuff
key
case
81 of dosomething endof
ctrlc of callaword endof
\etc...
;
hello
how could I trap ctrl+c key to call a word ?
just like
: test
\ some stuff
key
case
81 of dosomething endof
ctrlc of callaword endof
\etc...
;
without breaking forth interpretor execution but really using it as a key or input flow
currently whatever I tryied yet continues to use ctrl-c as BREAK signal...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 34:13:05 |
Calls: | 6,707 |
Files: | 12,239 |
Messages: | 5,353,328 |