another option is to use the tag "command" like this way:
<command name="cmdGravar"
onselect="classroot.pnlButtons.btnGravar.Execute()"
key="['Control','Alt', 'S']" />
"gravar" on my country means "save". This code tell laszlo to listen
for the combination of ctrl+alt+S to execute the action of the
onselect. In that case, execute my button named btnGravar.
but....
doesnt matter if u use this aproache or the one benjamin show, the
browser always rules what keys u can use or not. This, in my opinion is
a baaad bad thing. ;)
i mean... u cant use F5 to nothing on IE. If u have Google bar
installed on your firefox (like me) u cant use ctrl+alt+G coz he
intercept it. But, google bar of internet explorer dont use such
combination.
there are another combinations that work on one both not on another...
(and i am talking only about IE and firefox.... imagine if we put all
together.. netscape, opera, links (lol )
hope it helps.
Luís.
Benjamin Shine escreveu:
>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
>
>
>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user