[brailleblaster] Re: The VerifyKeyListener

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Sat, 11 Jun 2011 16:57:30 -0500

Actually, I've been wondering about this also. A document can be changed 
by replacing some text with some other, or by deleting text. The Modify 
and ExtendedModify listeners seem to detect this, but the documentation 
doesn't say wht the difference between them is. Conceivably text chold 
be changed by mouse action alone. Moreover, we aren't really concerned 
with text. We will be hasndling graphics. So we need to know when a 
graphic has changed. This might be by mouse action alone, for example, 
dragging or resizing it.

John

On Sat, Jun 11, 2011 at 10:33:14PM +0100, Michael Whapples wrote:
> Hello,
> May be I have lost where we are going here, but a question which may 
> need to be asked is, what determines if the "document" has changed? Is 
> it as simple as only key presses in the styled text controls may change 
> the document? Is there any other way the document may be modified? Can 
> the view provide sufficient information of whether the document has 
> changed? Just because a document looks the same, does that mean the 
> actual document itself is the same?
> 
> Michael Whapples
> On 06/11/11 16:51, Susan Jolly wrote:
> >The StyledText widget has a lot of OS-dependent default key bindings 
> >which you can discover either from its getKeyBinding() method or by 
> >looking at the source code.  You can overwrite the defaults and/or set 
> >additional bindings with the widget's setKeyBinding() method. You can 
> >listen directly for SWT.Key_Down events rather than 
> >usingVerifyKeyListener. . Here is a bit of code from the TextEditor 
> >example.
> >
> >styledText.addListener(SWT.KeyDown, new Listener() {
> >  public void handleEvent(Event event) {
> >   handleKeyDown(event);
> >  }
> >
> >Then in your handleKeyDown() method you can use event.keyCode to 
> >determine which key was pressed.
> >
> >Susan
> >
> 

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities


Other related posts: