Make a handler for LzKeys.onkeyup. Inside that handler, check  
whatever conditions interest you (LzFocus.getFocus() == myView, for  
instance) and then call the button action.

<canvas ...>
  <handler name="onkeyup" reference="LzKeys" args="k">
     Debug.write("key " + k + " up");
     myButton.doSomething();
   </handler>
   <button id="myButton">
        <method name="doSomething">
        ...

Does that work?
-ben

On Sep 6, 2006, at 9:26 AM, James Howe wrote:

> My OpenLaszlo application has several places where users have to  
> click on
> a button/tab to get something to happen.  I would like to create some
> keyboard shortcuts so that the user doesn't have to mouse around so  
> much.
> I've just spent some time searching the forums and didn't find any  
> topics
> which addressed this issue.  What I want to do is conceptually  
> simple, I
> want to associate some keystroke with a button or view.  When the
> containing view has the focus, when the user performs the key  
> action, it
> would be the same as if the user clicked on the button or widget.   
> Chapter
> 28 of the developer documentation seems to talk a little bit about  
> this
> subject, but the implementation seems quite complicated involving  
> creating
> a view that takes focus and processes keystrokes.
>
> Here's a simple example of the sort of thing I would like to do.  I  
> have a
> view which contains a list of items and some buttons.  I would like to
> assign the keystroke A, B, C to each of the buttons.  I want the  
> user to
> be able to tab around between the list and the buttons.  If the user
> clicks on the list (or tabs to the list control), I want the arrow  
> keys to
> move up and down in the list.  At any point if the user hits one of  
> the
> keys A, B or C, I want the button action to be invoked.  Is there a  
> good
> example of how to do something like this somewhere?
>
> Thanks!
>
> -- 
> James Howe
>
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to