>From: Fred Warren <fwarren_at_efn.org>
>
>\ End of Hijack words
>
>Now, when you click in the client area of the SwiftForth window, a right
>click will produce a "ding", but a left click does not. I think that some
>code other than SFMESSAGES is processing WM_LBUTTONDOWN messages before
>they get to the SFMESSAGES.
>
>Does anyone know why the above code does not work in the SwiftForth console
>window?
First, there is no such message as WM_RMOUSEBUTTONDOWN ;^)
The SwiftForth command window consists of two windows -- the one where
the text is written is a child of the main one. The handle of the main
container window, while in the interpreter, is in HWND, the handle of
the actual text display window is in HTEXT. The SFMESSAGES switch is
related to the container window; the text window actually gets all messages
first, and passes unwanted messages to the container. So, the LBUTTONDOWN
message is trapped by the text window, since we use it to do text marking
for the clipboard copy operation, and double-click because we use
it for locate.
The switch for the HTEXT window is MESSAGES in the CRT vocabulary. Try
ALSO CRT
[+SWITCH MESSAGES
WM_RBUTTONDOWN RUN: 1 MessageBeep DROP 0 ;
WM_LBUTTONDOWN RUN: 1 MessageBeep DROP 0 ;
SWITCH]
>While I am at it. I noticed that SwiftForth does not respond to WM_CHAR
>messages, i.e.
>
> HWND WM_CHAR 65 0 SendMessage DROP
>
>Does not produce a character on the display, if SwiftForth was receiving
>input from WM_CHAR, it would look just like I typed the letter "A" at the
>keyboard. It looks like EKEY does not go through windows to read the
keyboard.
>
>Does anyone know why Forth Inc. decided to poll the keyboard themselves
>instead of just capturing WM_CHAR messages?
This is for the same reason -- the wm_char message is intercepted by the
HTEXT window, not by the container. Also, note that wm_char is not
sufficient
by itself to implement a useful EKEY function, and so the code to implement
character input is quite convoluted, using the KEYDOWN and SYSKEYDOWN
messages,
as well as the CHAR and SYSCHAR messages to synthesize EKEY strokes.
If you really want to do that, try
HTEXT WM_CHAR 65 0 SendMessage, and your character will appear.
Rick VanNorman
.
Received on Thu May 27 1999 - 12:37:44 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.