Keyboard shortcuts for Flex UI components
06 Apr 2005
ALT + A = 197
ALT + B = 166
ALT + C = 199
---
A = 65
B = 66
C = 67
Happy coding... - id: 5739 author: jorge author_email: [email protected] author_url: http://jgutierrez.wordpress.com/ date: ‘2009-08-07 01:09:14 +0530’ date_gmt: ‘2009-08-06 20:09:14 +0530’ content: “thank for the script ;) \r\nI use the script of zied and work correctly” - id: 7350 author: Prasad author_email: [email protected] author_url: ‘’ date: ‘2010-02-22 14:44:00 +0530’ date_gmt: ‘2010-02-22 09:14:00 +0530’ content: “Hi,\r\n Ihave tried the ZIED code, Its not working. Can any one help me. My Sample Code attached.\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n” - id: 7353 author: perjabs author_email: [email protected] author_url: ‘’ date: ‘2010-02-24 18:07:00 +0530’ date_gmt: ‘2010-02-24 12:37:00 +0530’ content: “Hi, I am Prasad, I am trying to implement your code, But the CTRL F & CTRL S is not triggering. Code below and Let me know your feedback. I am Using sdk 3.3 & flash player 10.\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n\r\n\r\n\t\r\n\r\n\t\r\n\r\n” - id: 7488 author: Rameshkaveti9 author_email: [email protected] author_url: ‘’ date: ‘2010-11-08 17:05:00 +0530’ date_gmt: ‘2010-11-08 11:35:00 +0530’ content: “Hello,\r\n i tried this one but it’s not getting the out put plz help me here is my code\r\n\r\nvar bCTRLPressed:Boolean = event.altKey;\r\n\t\t\t\r\n\r\n\t\t\tif( bCTRLPressed)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar curKeyCode:int = event.keyCode;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(curKeyCode==78)\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\tModuleload(‘fooditem’,1);\r\n\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\nI am using Flex3 and flashplayer 10 “ ---
Again someone on flexcoders wanted to assign keyboard shortcuts for UI components/controls in his application. Following was my response with quick and dirty example..
Suppose you want to assign some keyboard shortcuts to each
control on screen so that when shortcut key is pressed, control gets
focussed and pressing enter/space execute associated action. For example, pressing space key while a button is focussed, would be broadcast button’s click event.
You can easily achieve this by using Key object, as demonstrated in code later.
I am assuming:
- user would press CTRL + 1, CTRL + 2 ...to focus a control on screen.
- user can press SPACE key to execute associated action with the controls
like Button, CheckBox, RadioButton or any button kind of component. - user can use arrow keys to change values in list type of controls like
ComboBox - user can type in textfield like control.…
Following example has some controls on screen and pressing CTRL + 1 .. CTRL\
- 5 shifts the focus to corresponding control.…
Following code is quick & dirty and just for demo, you can always write a ShortcutManager class in very OO way, which is more easier to use and managable...
###KeyObjectDemo.mxml###