Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to send/emulate a key to a shell?
How to send/emulate a key to a shell? [message #462590] Fri, 14 October 2005 02:40 Go to next message
Eclipse UserFriend
Originally posted by: webapp.gmx.de

How can I send a key to a shell. In my special case I want to emulate that
the user pressed the esc-key, so that a Dialog will be closed.

Thanks, Rudolf
Re: How to send/emulate a key to a shell? [message #462599 is a reply to message #462590] Fri, 14 October 2005 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Rudolf Schmidt wrote:
> How can I send a key to a shell. In my special case I want to emulate that
> the user pressed the esc-key, so that a Dialog will be closed.

Display.post(Event)

Remember to match every KeyDown with a KeyUp or things can become very weird
very quickly.



cheers,
d.
Re: How to send/emulate a key to a shell? [message #462638 is a reply to message #462599] Sat, 15 October 2005 17:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: webapp.gmx.de

Thanks for reply. Please give some more details, how do I get an event
instance?


"Douglas Pollock" <douglas.pollock@magma.ca> schrieb im Newsbeitrag
news:diog9k$egn$1@news.eclipse.org...
> Rudolf Schmidt wrote:
>> How can I send a key to a shell. In my special case I want to emulate
>> that
>> the user pressed the esc-key, so that a Dialog will be closed.
>
> Display.post(Event)
>
> Remember to match every KeyDown with a KeyUp or things can become very
> weird
> very quickly.
>
>
>
> cheers,
> d.
>
Re: How to send/emulate a key to a shell? [message #462640 is a reply to message #462638] Sat, 15 October 2005 22:42 Go to previous message
Eclipse UserFriend
Rudolf,
see Snippet146 - post key event (i think that yo have to call
key down and key up, always)
If you want close Dialog only (and Dialog is jface Dialog) call
close.
Peco
Rudolf Schmidt wrote:

> Thanks for reply. Please give some more details, how do I get an event
> instance?
>
>
> "Douglas Pollock" <douglas.pollock@magma.ca> schrieb im Newsbeitrag
> news:diog9k$egn$1@news.eclipse.org...
>> Rudolf Schmidt wrote:
>>> How can I send a key to a shell. In my special case I want to emulate
>>> that
>>> the user pressed the esc-key, so that a Dialog will be closed.
>>
>> Display.post(Event)
>>
>> Remember to match every KeyDown with a KeyUp or things can become very
>> weird
>> very quickly.
>>
>>
>>
>> cheers,
>> d.
>>
Previous Topic:How do you export a standalone SWT executable?
Next Topic:tab between columns in a table tree
Goto Forum:
  


Current Time: Sun Jul 27 02:00:00 EDT 2025

Powered by FUDForum. Page generated in 0.28523 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top