Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to get VerifyEvent properties: keyCode and start/end at same time?
How to get VerifyEvent properties: keyCode and start/end at same time? [message #547820] Mon, 19 July 2010 17:01 Go to next message
Jeffery Yuan is currently offline Jeffery YuanFriend
Messages: 27
Registered: July 2009
Junior Member
Hi, all:
In my rcp application, there is an editor, I need disable backspace and delete key in some cases.
So I need add VerifyKeyListener or VerifyListener.
I also need know event properties: keyCode and start/end at same time.

But in VerifyKeyListener, the VerifyEvent only contains fields: keyCode, character and stateMask.
In VerifyListener, the VerifyEvent only contains fields: start, end, text, no keyCode, character and stateMask information.

Is there a trick to get VerifyEvent properties: keyCode and start/end at same time?

Thanks for any help and reply in advance : )
Re: How to get VerifyEvent properties: keyCode and start/end at same time? [message #547906 is a reply to message #547820] Tue, 20 July 2010 07:12 Go to previous messageGo to next message
Praveen Missing name is currently offline Praveen Missing nameFriend
Messages: 6
Registered: July 2009
Junior Member
I am not sure whether I missed anything from your problem scenario. The
event VerifyEvent extends keyEvent which contains keycode. So, the
VerifyEvent event should contain start,end and keyCode fields together.
May be, you should have a look at the existing snippets (esp Snippet243
or Snippet289) that all the fields - start, end and keyCode are
available in VerifyListener. I just verified it using sysout statements
in VerifyListener :)
Re: How to get VerifyEvent properties: keyCode and start/end at same time? [message #548234 is a reply to message #547820] Wed, 21 July 2010 08:19 Go to previous message
Jeffery Yuan is currently offline Jeffery YuanFriend
Messages: 27
Registered: July 2009
Junior Member
Hi, Praveen:
Thanks for your response.
In VerifyKeyListener, and VerifyListener, they do conatain these fileds, but some values are invalid, not filled.

For example:
I select the text from position 0 to 11, and click backspace:
In VerifyKeyListener, it prints:
VerifyEvent{StyledText {} time=162508109 data=null character='' keyCode=8 keyLocation=0 stateMask=0 doit=true start=0 end=0 text=null}

Only fields - character, keyCode, stateMask contains valid value,
start=0 end=0 text=null, obviously they are not valid.

In VerifyListener, it prints:
VerifyEvent VerifyEvent{StyledText {} time=162508109 data=null character='\0' keyCode=0 keyLocation=0 stateMask=0 doit=true start=1 end=11 text=}

Only fields - start, end, text contains valid value,
character='\0' keyCode=0, obviously they are not valid.
Previous Topic:Too thick window borders in Ubuntu 10.04
Next Topic:Customizing MessageBox
Goto Forum:
  


Current Time: Thu Mar 28 22:42:04 GMT 2024

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

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

Back to the top