Re: Test & Questions

reno@smart.net
Tue, 16 Jul 1996 19:54:49 +0000

> a) How can I write a KeyboardHandler under Geos? I managed to send all
> keyboard-entry to one method (via MSG_META_KBD_CHAR) - so I can't leave the
> app via the F3-key anymore - but pressing "a" doesn't do what it should.
> (I'm trying to write some action-games, so it is necessary to get the
> pressed keys without displaying them).

There are two examples in the RenoComm source code (recently posted to
comp.binaries.geos, I can post it here if there's enough demand; the
zip file is 28K):

1. In a Text object, intercept MSG_VIS_TEXT_FILTER_VIA_CHARACTER. You'll need
to set ATTR_VIS_TEXT_EXTENDED_FILTER = VTEFT_CHARACTER_LEVELER_LEVEL
(for VisText; use ATTR_GEN_TEXT.... for GenText)

2. Intercept MSG_META_KBD_CHAR and read the scancodes directly, which you're
already apparently doing. Note that this bypasses the keyboard driver, so
you'll have trouble with non-US keyboards. One odd thing though - F3 still
works for me. I'd rather it didn't, I want a fully reprogrammable keyboard...

Mind you, I'm doing that in a VisText too, which may make a difference.

BTW, the scancode for A is 1E, but you should probably use 4B, the left arrow
instead....

- ------------------------------------------------------------------------------
"Why do your people always ask if someone is reno@smart.net
ready right before you do something massively unwise?"
- Delenn, Babylon 5/War Without End by J. Michael Straczynski O-