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

Home » Public Forums » archive » Keyboard events
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 events [message #21069 is a reply to message #20846] Thu, 03 August 2000 00:00 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Doug Reynolds wrote:
>
> I'm in the process of writing a new application, and several of the likely
> users have requested that I allow various keyboard "shortcuts", as an
> alternative to clicking on various controls with the mouse. For example,
> we will need to define a region in an image that will be zoomed in a
> separate draw window, and it would be nice to be able to use arrow keys
> to position and resize the zoom region.
>
> I've never tried to do this before in IDL (previously I've been content
> to handle mouse events), so I went looking through the manuals to figure
> out how to do it. Unfortunately, the event handling routines seem to be
> limited to mouse and focus events. The closest thing I could find was the
> get_kbrd function; someone here suggested putting a call to get_kbrd in
> the event handling function. However, it would seem that this would cause
> keyboard events to queue up, unprocessed, until the user wiggled the mouse.
> In other words, it doesn't seem to be quite what I need.
>
> Is there something in the documentation that I have overlooked? Any ideas
> would be most appreciated.
>
> Doug

I think I recently posted a follow-on entitled "More keyboard events" to my hack
of many years ago which allows cursor key widget events. It increases the
hackery to some degree and has cross-platform issues, but sometimes, you just
need them.

An example program is included in the post. My original hack is widely used in
a variety of programs, including popular ones such as atv, so it's stability is
probably pretty good. The new hack has undergone limited testing, so beware.
I've been using it with success under Unix, but your mileage may vary.

Good luck,

JD


--
J.D. Smith /*\ WORK: (607) 255-6263
Cornell University Dept. of Astronomy \*/ (607) 255-5842
304 Space Sciences Bldg. /*\ FAX: (607) 255-5875
Ithaca, NY 14853 \*/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Call for Political Action (Was: Top 10 List)
Next Topic: Top 10 for old farts

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

Current Time: Sat Oct 11 01:49:36 PDT 2025

Total time taken to generate the page: 0.24180 seconds