Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT equivalent to Swing event.isActionKey() ??
SWT equivalent to Swing event.isActionKey() ?? [message #448000] Thu, 23 December 2004 16:11 Go to next message
strus is currently offline strusFriend
Messages: 113
Registered: July 2009
Senior Member
Hi,
What is the equivalent of event.isActionKey() (where event is a KeyEvent)
in SWT ?

Thanks.
Re: SWT equivalent to Swing event.isActionKey() ?? [message #448001 is a reply to message #448000] Thu, 23 December 2004 16:25 Go to previous messageGo to next message
Liam Morley is currently offline Liam MorleyFriend
Messages: 47
Registered: July 2009
Member
What I'm thinking you might be looking for is a TraverseListener instead
of a KeyListener.

myText.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
switch (e.detail) {
case SWT.TRAVERSE_RETURN:
System.out.println("return");
case SWT.TRAVERSE_ESCAPE:
System.out.println("escape");
}
}
});


strus wrote:
> Hi,
> What is the equivalent of event.isActionKey() (where event is a
> KeyEvent) in SWT ?
>
> Thanks.
>


--
Liam Morley
Computer Science Undergraduate
Worcester Polytechnic Institute
Re: SWT equivalent to Swing event.isActionKey() ?? [message #448002 is a reply to message #448000] Thu, 23 December 2004 17:17 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
There is not an equivalent to isActionKey(), but you can detect any keypress
from the event's character and/or keycode, and any keyboard modifier from
the event's stateMask. For an example see:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet25.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup .

Grant


"strus" <strus_fr@yahoo.fr> wrote in message
news:cqeqng$li3$1@www.eclipse.org...
> Hi,
> What is the equivalent of event.isActionKey() (where event is a KeyEvent)
> in SWT ?
>
> Thanks.
>
Re: SWT equivalent to Swing event.isActionKey() ?? [message #448083 is a reply to message #448002] Thu, 30 December 2004 19:45 Go to previous message
strus is currently offline strusFriend
Messages: 113
Registered: July 2009
Senior Member
My issue is to send the keycode to a function and the character to
another ... (it is to emulate a vterm ...)
So what i did is to detect if the character is null (0x01) ...
Don't know if it is the same behaviour but seems to meet my
requierements ...


Grant Gayed wrote:
> There is not an equivalent to isActionKey(), but you can detect any keypress
> from the event's character and/or keycode, and any keyboard modifier from
> the event's stateMask. For an example see:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet25.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup .
>
> Grant
>
>
> "strus" <strus_fr@yahoo.fr> wrote in message
> news:cqeqng$li3$1@www.eclipse.org...
>
>>Hi,
>>What is the equivalent of event.isActionKey() (where event is a KeyEvent)
>>in SWT ?
>>
>>Thanks.
>>
>
>
>
Previous Topic:Why gc.getCharWidth('A') always returns 0 ????
Next Topic:emulate vterm with SWT
Goto Forum:
  


Current Time: Sat Apr 17 09:46:09 GMT 2021

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

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

Back to the top