RE: [flexcoders] F2B3 -- global keyboard event capture, problems with focus
IIRC, the docs have been updated for this. Have you tried adding the listener to all keydown events on the stage? Like this: stage.addEventListener(KeyboardEvent.KEY_DOWN, myHandler) BTW, you can always set focus programmatically using the UIComponents setFocus() method. hth, matt horn flex docs From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Bray Sent: Monday, June 05, 2006 3:06 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] F2B3 -- global keyboard event capture, problems with focus I'm trying to capture global keyboard events so I can implement keyboard shortcuts in my app. Let's say it's an email app and as soon as it loads you want to press CTRL+M to show a New Message popup. The docs on handling keyboard events make it sound like this is possible, but the sample code provided doesn't work unless you set focus by clicking on a button (or list item, or textInput, etc) in your app first. Clicking a Canvas isn't enough. Is there a good way to handle these events without making the user click on something first? Can a Canvas have focus? Can I programatically assign focus? What I'm finding is that even after following these steps... 1. click on something to set focus 2. use the keyboard shortcut to display a popup 3. click a button in that popup to dismiss it ...focus is now lost and I can't use CTRL+M to open a new popup unless I click on something else. That defeats the purpose of keyboard shortcuts so I'm hoping there's a better way. Thanks, Tom -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] F2B3 -- global keyboard event capture, problems with focus
Matt/Anyone, is there a way to do this at an mx:Application tag level, so that the same handler is used across all files? I'm looking for this sort of solution for Flex 1.5. Thanks! --- Pablo Apanasionek De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Matt HornEnviado el: Lunes, 05 de Junio de 2006 17:35Para: flexcoders@yahoogroups.comAsunto: RE: [flexcoders] F2B3 -- global keyboard event capture, problems with focus IIRC, the docs have been updated for this. Have you tried adding the listener to all keydown events on the stage? Like this: stage.addEventListener(KeyboardEvent.KEY_DOWN, myHandler) BTW, you can always set focus programmatically using the UIComponents setFocus() method. hth, matt horn flex docs From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom BraySent: Monday, June 05, 2006 3:06 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] F2B3 -- global keyboard event capture, problems with focus I'm trying to capture global keyboard events so I can implement keyboard shortcuts in my app. Let's say it's an email app and as soon as it loads you want to press CTRL+M to show a "New Message" popup. The docs on handling keyboard events make it sound like this is possible, but the sample code provided doesn't work unless you set focus by clicking on a button (or list item, or textInput, etc) in your app first. Clicking a Canvas isn't enough. Is there a good way to handle these events without making the user click on something first? Can a Canvas have focus? Can I programatically assign focus? What I'm finding is that even after following these steps...1. click on something to set focus2. use the keyboard shortcut to display a popup3. click a button in that popup to dismiss it...focus is now lost and I can't use CTRL+M to open a new popup unless I click on something else. That defeats the purpose of keyboard shortcuts so I'm hoping there's a better way. Thanks,Tom -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] F2B3 -- global keyboard event capture, problems with focus
Matt,The docs at this location:http://livedocs.macromedia.com/labs/1/flex20beta3/0479.htmlStill say to use application.addEventListener . After changing it to stage and waiting for applicationComplete to set up my listeners, it works the way I want it to.Thanks!-TomOn 6/5/06, Matt Horn [EMAIL PROTECTED] wrote: IIRC, the docs have been updated for this. Have you tried adding the listener to all keydown events on the stage? Like this: stage.addEventListener(KeyboardEvent.KEY_DOWN, myHandler) BTW, you can always set focus programmatically using the UIComponent's setFocus() method. hth, matt horn flex docs From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Bray Sent: Monday, June 05, 2006 3:06 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] F2B3 -- global keyboard event capture, problems with focus I'm trying to capture global keyboard events so I can implement keyboard shortcuts in my app. Let's say it's an email app and as soon as it loads you want to press CTRL+M to show a New Message popup. The docs on handling keyboard events make it sound like this is possible, but the sample code provided doesn't work unless you set focus by clicking on a button (or list item, or textInput, etc) in your app first. Clicking a Canvas isn't enough. Is there a good way to handle these events without making the user click on something first? Can a Canvas have focus? Can I programatically assign focus? What I'm finding is that even after following these steps... 1. click on something to set focus 2. use the keyboard shortcut to display a popup 3. click a button in that popup to dismiss it ...focus is now lost and I can't use CTRL+M to open a new popup unless I click on something else. That defeats the purpose of keyboard shortcuts so I'm hoping there's a better way. Thanks, Tom -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service . __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___