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

Home » Public Forums » archive » Keyboard input from widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Keyboard input from widgets [message #29346] Wed, 13 February 2002 08:22 Go to next message
to_oleg is currently offline  to_oleg
Messages: 2
Registered: December 2001
Junior Member
Hi,
I have draw widget and I use mouse events in it (cursor moving and
buttons). I need to know also what key on keyboard was pressed (for
example, for precision moving of mouse cursor). Problem that
base_widget does't generate events for keyboard and draw_widget
switches into stdin (IDL command line). Probably I can use timer
events and get_kbrd() to check keyboard buffer.
Is there another way ?
Thank you.
Re: Keyboard input from widgets [message #29414 is a reply to message #29346] Fri, 15 February 2002 01:43 Go to previous messageGo to next message
alt is currently offline  alt
Messages: 28
Registered: August 2001
Junior Member
I use for this purpose widget_text trick
(it's visible because there are situations when focus nevertheless
become lost) and TVCRS to position cursor on widget_draw. The only
inconvenience is widget_text does not catch arrow keys and one should
use some text keys.
I would recommend "ASDW" keys - standard direction keys in games
(a pair hours of Quake and you'll forget about arrows :-))

Probably it can be overcome if use widget_table instead of
widget_text. Table cell selection events catch arrow keys and edit
cell mode catch text keys. But I didn't check it.

Altyntsev Dmitriy,
Remote Sensing Center
Irkutsk, Russia
http://ckm.iszf.irk.ru


to_oleg@mail.ru (Oleg Kornilov) wrote in message news:<820c611d.0202130822.7806e3dc@posting.google.com>...
> Hi,
> I have draw widget and I use mouse events in it (cursor moving and
> buttons). I need to know also what key on keyboard was pressed (for
> example, for precision moving of mouse cursor). Problem that
> base_widget does't generate events for keyboard and draw_widget
> switches into stdin (IDL command line). Probably I can use timer
> events and get_kbrd() to check keyboard buffer.
> Is there another way ?
> Thank you.
Re: Keyboard input from widgets [message #29443 is a reply to message #29414] Wed, 20 February 2002 19:42 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
Altyntsev Dmitriy wrote:
>
> I use for this purpose widget_text trick
> (it's visible because there are situations when focus nevertheless
> become lost) and TVCRS to position cursor on widget_draw. The only
> inconvenience is widget_text does not catch arrow keys and one should
> use some text keys.
> I would recommend "ASDW" keys - standard direction keys in games
> (a pair hours of Quake and you'll forget about arrows :-))
>
> Probably it can be overcome if use widget_table instead of
> widget_text. Table cell selection events catch arrow keys and edit
> cell mode catch text keys. But I didn't check it.
>
> Altyntsev Dmitriy,
> Remote Sensing Center
> Irkutsk, Russia
> http://ckm.iszf.irk.ru
>
> to_oleg@mail.ru (Oleg Kornilov) wrote in message news:<820c611d.0202130822.7806e3dc@posting.google.com>...
>> Hi,
>> I have draw widget and I use mouse events in it (cursor moving and
>> buttons). I need to know also what key on keyboard was pressed (for
>> example, for precision moving of mouse cursor). Problem that
>> base_widget does't generate events for keyboard and draw_widget
>> switches into stdin (IDL command line). Probably I can use timer
>> events and get_kbrd() to check keyboard buffer.
>> Is there another way ?
>> Thank you.

I posted an update to my widget_text trick a long while back which in
fact traps arrow keys too. It is even more of a hack:


widget_control, self.wHid,/INPUT_FOCUS,set_value=['..','..','..'], $
SET_TEXT_SELECT=self.base_pos

You can then detect arrow keys using WIDGET_TEXT_SEL events, and the
TEXT_OFFSET_TO_XY keyword to widget_info(). Highly hackish, works
poorly on some systems, but overall, fun to use.

You can read more about it here:

http://groups.google.com/groups?selm=392B1991.CB765706%40ast ro.cornell.edu

I have a general purpose keyboard processing object which is part of a
large framework of image tools I'm hoping to release "real soon now".
Watch this space.

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Variance in sub-sections?
Next Topic: Does anybody know an 'undocumented IDL feature' that does this

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

Current Time: Fri Oct 10 00:21:56 PDT 2025

Total time taken to generate the page: 1.75886 seconds