comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: keyboard input
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: keyboard input [message #12929] Thu, 24 September 1998 00:00
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
Rob MacLeod wrote:
>
> Folks,
>
> Simple, beginners questions, but I want to have some very basic control
> over a program via the keyboard. For example, viewing a set of images and
> use "n" for next image "p" for previous, etc. Widgets are overkill and
> more time than I am willing to commit. But instead a command that waits
> for keyboard input, returns the value entered, which I then process inside
> the program. Braindead stuff in any other language I have used but I
> cannot seem to find it in IDL (maybe it's me who is braindead on this one
> (-: ).
>
> If this matters, I need this for the Mac implementation of IDL 5
>
> Thanks,
>

How about:

repeat begin
k=get_kbrd(1)
print,'Got key '+k
endrep until k eq 'q'

Replace "Got key" with a case statement, or whatever you'd like to do
with the key string in your program. Braindead enough? I think a 2nd
grader could read this and understand what it means.

JD
[Message index]
 
Read Message
Previous Topic: Re: How can I introduce a 'Interrupt button' into an IDL loop.
Next Topic: How can I introduce an 'Interrupt button' into an IDL loop

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 10:42:24 PDT 2025

Total time taken to generate the page: 0.63884 seconds