[brailleblaster] Re: The VerifyKeyListener

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

Thanks, this will be very helpful. A method to change the StyledText 
default keybindings will be absolutely necessary. 

John

On Sat, Jun 11, 2011 at 09:51:08AM -0600, 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: