Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get up/dn/left/right arrows in WIN32FORTH? EKEY doesn't

131 views
Skip to first unread message

Zoltan Spin

unread,
May 1, 2022, 1:15:39 PM5/1/22
to
Hi!
Discovering the just loaded Win32Forth, I found that EKEY doesnt provide anything when arrows are pressed, which is quite an issue when any user interface is needed.

What did I miss?

If I get this to work, maybe latter I ask about the mouse state.

Thank you for any help
Zoltan

NN

unread,
May 1, 2022, 7:05:43 PM5/1/22
to
I havent used win32forth in a while so please test as I am not sure which applies

: test begin ekey? 0= while repeat ekey . ;
type test and press any F-key

do you get a number ? if yes that number represents the f-key.

or

try :
: test begin ekey? 0= while repeat ekey ekey>fkey .s ;

you can use the function ekey>fkey as shown in
https://forth-standard.org/standard/facility/EKEYtoFKEY

One of these should work.


dxforth

unread,
May 2, 2022, 12:47:01 AM5/2/22
to
Not out-of-the-box anyway. A quick browse of the docs brought no joy despite
K-UP etc being provided. ISTM systems claiming ANS/200x features should at
least dedicate a section in the docs explaining how users can get them up
and running. It's not just Win32Forth that has this problem e.g. how many
'standard' systems can run your two 'standard' scripts?

Anton Ertl

unread,
May 2, 2022, 2:57:52 AM5/2/22
to
dxforth <dxf...@gmail.com> writes:
>On 2/05/2022 09:05, NN wrote:
>> : test begin ekey? 0= while repeat ekey . ;
>> type test and press any F-key
>>
>> do you get a number ? if yes that number represents the f-key.
>>
>> or
>>
>> try :
>> : test begin ekey? 0= while repeat ekey ekey>fkey .s ;
...
> how many
>'standard' systems can run your two 'standard' scripts?

Ok, I tested a few with the following:

1) : test begin ekey? 0= while repeat ekey . ; test \ press cursor-up
2) : test begin ekey? 0= while repeat ekey ekey>fkey .s ; test \ press cursor-up
3) k-up .

Here's what I got:

1) 2) 3) System
2147483650 2147483650 -1 2147483650 gforth-0.7.3
3328 3328 -1 3328 iForth-5.1-mini
256 ekey>fkey ? 256 sf 3.11
27 [A ekey>fkey ? k-up ? vfxlin 5.11 RC2

- 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 2021: https://euro.theforth.net/2021

Howerd Oakford

unread,
May 4, 2022, 8:23:49 AM5/4/22
to
Hi Zoltan,

Which version of Win32Forth are you using?
With Win32Forth6v05H :

Win32Forth: ANS Forth for Windows 95/98/ME/NT/2K/XP/7/8/10
Version: 6.05 Build: 0100 453K bytes free

I get "ekey hex . 20006" when I press the up-arrow key.

Win32Forth6v05H is available here :
http://www.inventio.co.uk/Win32Forth6v05H.7z

Cheers,
Howerd

dxforth

unread,
May 4, 2022, 8:53:41 PM5/4/22
to
On 2/05/2022 14:46, dxforth wrote:
>
> Not out-of-the-box anyway. A quick browse of the docs brought no joy despite
> K-UP etc being provided.
No further info on the above however Google brought up this new doc on
Win32Forth by Bill Ragsdale:

https://github.com/BillRagsdale/WIN32Forth-Guide

The 'official' Win32Forth site is here:

http://win32forth.sourceforge.net/

Jos Ven

unread,
May 5, 2022, 4:18:54 AM5/5/22
to
Op zondag 1 mei 2022 om 19:15:39 UTC+2 schreef Zoltan Spin:
In Win32For version 6.15.04 that is possible by creating
a window and use then use the WM_KEYDOWN message.
That will give you the needed scan code.
Jos

Zoltan Spin

unread,
May 6, 2022, 4:01:22 PM5/6/22
to
Thank you NN, Dxforth, Anton, Howerd, Jos for your quick and kind comments.
I tried again and got this:

\ Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
ekey . -7FFFFFFE ok \ up
ekey . -7FFFFFFD ok \ dn
ekey . -80000000 ok \ left
ekey . -7FFFFFFF ok \ right

\ Win32Forth: a 32 Bit Forth for Windows 95/98/ME/NT4/W2K/XP/VISTA/W7/W8/W10
\ Version: 6.15.05 Build: 2
ekey . never got anything, like keys are disconnected. (nor anything from ekey?)

=> I go on with Gforth.
This will occupy me nicely for a few months, and then I need to use the mouse (anticipating some headache too ;-)

An opinion: Forth would be way more in use if it takes into account that people need to make visuals.
Like there are words to manipulate I/Os like in all languages, without requiring a skilled professional insight into the computer guts.
Having said that, It is beyond my limited knowledge to understand the issue, I can only highlight the need.

Thanks again,
Zoltan

Jan Coombs

unread,
May 6, 2022, 5:50:48 PM5/6/22
to
On Fri, 6 May 2022 13:01:21 -0700 (PDT)
Zoltan Spin <kvieta....@gmail.com> wrote:

> \ Win32Forth: a 32 Bit Forth for Windows 95/98/ME/NT4/W2K/XP/VISTA/W7/W8/W10
> \ Version: 6.15.05 Build: 2
> ekey . never got anything, like keys are disconnected. (nor anything from ekey?)

Downloaded version from Howerd's link.
Windows7 found where to get 7z de-compressor, but instead.
Converted to .zip on host linux machine.
Windows unzipped this into downloads folder
Ran win32for.exe from there:

Win32Forth: ANS Forth for Windows 95/98/ME/NT/2K/XP/7/8/10
Version: 6.05 Build: 0100 453K bytes free
OS: Windows 7 Home directory: C:\Users\Jan\Downloads\Win32Forth6v05H

ekey hex . 20006 ok \ up
ekey hex . 20005 ok \ right
ekey hex . 20007 ok \ down
ekey hex . 20004 ok \ left

Jan Coombs
--

Rick C

unread,
May 6, 2022, 11:04:15 PM5/6/22
to
Platform: Windows 10 Home, 8,747k bytes free

ekey hex . D ok \ Enter

It simply did not respond to any of the arrow keys. It finally responded when I touched the Enter key.

It did not respond to any of the other similar keys, like Home, End, F1, F2... etc. until I reached F10.
ekey hex . 10010 ok \ F10 key

No response to the Delete key, but Backspace did.

ekey hex . 8 ok \ BS

So what would have changed in key handling between 6.05 and 6.15.05

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

Zoltan Spin

unread,
May 7, 2022, 8:48:10 AM5/7/22
to
==================================================================
gnuarm,
I had a doubt after reading Jan Coombs, and did exactly the same as you yesterday, with exactly the same (non) result:

Win32Forth: a 32 Bit Forth for Windows 95/98/ME/NT4/W2K/XP/VISTA/W7/W8/W10
Version: 6.15.05 Build: 2
Compiled: dimanche, avril 10 2022, 9:02
Platform: Windows 10 Home, 8,745k bytes free
2,812 Words in Application dictionary
2,631 Words in System dictionary
5,443 Words total in dictionaries
20,312 Windows Constants available
Loading Win32For.CFG
Loading Win32ForUser.CFG

Current directory is: C:\Users\Tech\Win32Forth\Win32Forth
Program path is: C:\Users\Tech\Win32Forth\Win32Forth\Win32for.exe
Forth path is: C:\Users\Tech\Win32Forth\Win32Forth\
Application path is: not set

System Editor is: Win32Forth IDE

ekey hex . D ok \ here exited as you as I could..
.s empty ok
0 new messages