Q
We have a requirement wherein the users need to have the ability to have hotkeys /shortcuts to perform certain operations, like (triggering a particular link, submiting a form ).Does Flex platform have a built macro / shortcut support to do something like this?
W
There’s no built-in support in the framework as of now. It’s been on the “nice to have” features list, but somehow didn’t make it in this release. Now, this is something you could build on your own easily though. You’d have to listen for the key events on the “system manager” object in the “capture” phase.
systemManager.addEventListener("keyUp", globalKeyUp, true /* capture */ );
You can allow the developer to then map specific keys to specific event handlers.
…
And so on.
Manish



is there any more examples ?
Thanks very much for this info!
For sample code add mx:script
public function createListener():void {
systemManager.addEventListener(“keyUp”, globalKeyUp, true /* capture */ );
}
public function globalKeyUp(e:KeyboardEvent):void {
if ((e.keyCode==65) && (e.ctrlKey) && (e.altKey))
{
txtName.setFocus();
}
}
Thanks very much for this info!
For sample code add mx:script
hgjhj
I’m not sure what version of Flex you have but with Flex 3.2, there IS NO: SystemManager.addEventListener( …
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
It’s because you have to use
systemManager.addEventListener( …
No capital S