Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Doing some action upon key press
Doing some action upon key press [message #456250] Fri, 27 May 2005 15:34 Go to next message
Jens Rossbach is currently offline Jens RossbachFriend
Messages: 14
Registered: July 2009
Junior Member
Hello,

I have a dialog window (a progress window, which tracks a certain operation)
which should be closed when user presses ESC and the operation this dialog
tracks should be canceled. How can I do this best? The closing of the dialog is
already automatically done when pressing ESC, but how can I listen to the key
press and cancel the operation? Adding a key listener to the shell does not work.


Jens
Re: Doing some action upon key press [message #456301 is a reply to message #456250] Mon, 30 May 2005 14:25 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
I believe this snippet does exactly what you want:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet4.java?rev=HEAD&am p;content-type=text/vnd.viewcvs-markup

"Jens Rossbach" <web001@jrossbach.de> wrote in message
news:d77esm$1c2$1@news.eclipse.org...
> Hello,
>
> I have a dialog window (a progress window, which tracks a certain
operation)
> which should be closed when user presses ESC and the operation this dialog
> tracks should be canceled. How can I do this best? The closing of the
dialog is
> already automatically done when pressing ESC, but how can I listen to the
key
> press and cancel the operation? Adding a key listener to the shell does
not work.
>
>
> Jens
Previous Topic:SWT checkbox on Solaris/Motif much too high
Next Topic:Window title font
Goto Forum:
  


Current Time: Fri Apr 26 05:10:27 GMT 2024

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

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

Back to the top