Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

event.keyCode == Keyboard.ESCAPE not captured from laptop during FULLSCREEN

New Here ,
Jan 11, 2008 Jan 11, 2008
I've encountered similar problems capturing keyboard events from laptops before, which is why I'm using keyboard.ESCAPE instead of keycode 21. The same keyboard event handler fires on some of the laptop keystrokes, but not all - so the handler is working. I'm wondering if the issue is not just the quirky key assignments in some laptops, but might have something to do with the FULLSCREEN state disengaging the keyboard. Maybe I should be listening for something else that is happening when the escape key is pressed while in FULLSCREEN state?

I can post my code if needed, but I think this is has more to do with knowing what event to listen for that is only hinted at in the documentation I've been looking at re FULL_SCREEN.
TOPICS
ActionScript
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 11, 2008 Jan 11, 2008
As far as I know all keyboard input is disabled for event handlers in fullscreen mode. Its to limit the possibility of 'phishing' type activity. (e.g. bad stuff like:simulating a browser screen with a real looking bank url in the address bar... or some other login access page).

So its a good thing that its limited, because otherwise flash player would quickly become unpopular.

All you can do in this situation is detect the change from full screen to normal state. If that's not the result of pressing a button (which you would know about anyway) that executes code to switch the display states then it is because someone pressed the ESC key.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 12, 2008 Jan 12, 2008
I undersatnd and agree with that and I've tried coding to detect that event, but I haven't had any luck there either. Maybe I'm attaching the listener to the wrong object? (which would be..?) Or I'm not constructing the object/listener correctly? Or instantiating the object class?

I've tried using various sample codes for fullscreen toggling that I've found on the adobe site, but haven't had any success with those, either. One tries to attach a listener to a MouseEvent associated with the stage and/or fullscreen rect- but that doesn't work and doesn't seem to me to make sense since it's the ESC key that toggles out of Full.

Anyway, the whole reason I'm trying to detect this event (BTW if the keyboard is fully disengaged, how is the ESC press detected by the FullScreen status?), is because I first want the clip to display in a scaled state inside my player "screen" and then, if the user chooses to watch at FullScreen and then return, I want the return to be to the scaled version "inside" my player "screen" rather than to its own size, which is what the "Normal" screen returns it to now, apparently by default.

There just has to be some way to get between that event and that default behavior. right?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 12, 2008 Jan 12, 2008
The keyboard is not 'disengaged' really - its just that flash is not responding to it.
The escape key is an exception but as you've found its not visible directly at the actionscript level - its only used by the flash player itself.

What you can detect is the change in fullscreen mode:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html#event:fullScreen

If that event triggers when you haven't requested a change yourself from fullscreen in code (e.g. from a 'toggle fullscreen button')... then its likely to be via the ESC button.

There's an example of listening for the relevant event here:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Part...

you could adapt that
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 13, 2008 Jan 13, 2008
That worked Super Bueno!

Much Thanks.

Now I've got to find out something else, but it's very hard to search for stuff the way things seem to be set up in the knowledge base - how would I have found that solution from your last post? Maybe knowing that will help me avoid prolonged roadblocks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 14, 2008 Jan 14, 2008
LATEST
You're welcome. It just so happens that I had faced a situation where I had done the same thing in as2 a few months back and I've answered a couple of the posts similar to yours about it since.

It's not so easy to describe a generic process for figuring out stuff like that. If I'm looking for something like that example above which is not immediately obvious (e.g. something that would relate to a method, event or property of class where I would just look it up in the docs) then I kind of go through these thought processes:

(this is probably biased a little bit towards the example above)
1. Acceptance: OK so I can't do that with the class I want to use.
2. Are there any other related classes?
3. Can I redefine what I want to do in terms of something else that's happening (events) or in terms of other input parameters?

And probably at least 80% of the time (lol):
Has someone else dealt with it and what words do I need to type into google to find their solution that they shared online somewhere?
-This forum and others like it are a great resource but I have to say the search facility here is fairly basic. I mostly use search here for a single keyword to locate something I vaguely remember being discussed on a previous occasion. Otherwise I'd use an external search engine.

At that point if I can't find anything that's when I'd post a question here. Probably nothing really insightful there... but you asked. And no-one else has asked me that question before, lol.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines