In message
<[EMAIL PROTECTED]
nett.com>, "Miller, Raul D" <[EMAIL PROTECTED]> wrote
>Jonathan Griffitts wrote:
>> I am looking for a way to check for keyboard input during execution
>> of a J script, but *not* halt and wait for a key.  What I need is a
>> way to check for command keystrokes and respond if any key has been
>> pressed, but just go on running if not.
>
>You can put an isigraph control on a form, and use glcapture.

Thanks for the helpful suggestions.

Unfortunately there seem to be some issues.  The glcapture method does
not pass along control characters.

wd'qkeystate x' works but gives key state rather than keypress
information, so it makes me do that decoding.  That's not a big issue
(look for changes in the array) but it's a bit ugly, and it's
reinventing information that the keyboard firmware already provides.

I'm thinking of just mixing in a little C or C++ code, either calling
J.DLL from a top-level C routine, or else writing a stupid, simple DLL
that checks for keystrokes and returns them to the J routine.  I haven't
ever tried mixed-language work with J, but if I want to learn how to do
it, it seems this might be a nice simple case.

-- 
                        Jonathan Griffitts
AnyWare Engineering                             Boulder, CO, USA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to