Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-25-2003, 08:17 AM   #1
szd
Registered User
 
Join Date: Jul 2003
Location: Hungary
Posts: 2
Default processing F1 and ESC keys

Hello,

Is there a way to process F1 and ESC keypresses in actionscript?
The problem is, when I press F1 in the movie (which is a game actually) the browser's help will be displayed too.
ESC does not even get to the movie, it will be 'consumed' by the player. I assume it's the 'pause' hotkey for the player, that's why it's not directed to the movie itself.

Any ideas?
Thanks.
szd is offline   Reply With Quote
Old 07-25-2003, 11:42 AM   #2
thoriphes
Registered User
 
Join Date: Jul 2003
Posts: 14
Send a message via AIM to thoriphes
Default

you definitely can't use F1 (or any other Fx key i don't think) because it will always bring up the help. If you want to track the ESCAPE key, however, you can use this code (put it in the first root frame):
ActionScript Code:
keyList = new Object(); Key.addListener(keyList); keyList.onKeyUp = function () { if (Key.getCode() == Key.ESCAPE) { do whatever you want. } }
of course, this code will work anywhere else too.
thoriphes is offline   Reply With Quote
Old 07-25-2003, 01:40 PM   #3
szd
Registered User
 
Join Date: Jul 2003
Location: Hungary
Posts: 2
Default

The problem is, the onKeyDown handler won't be called for the ESC key. It will be called for every other key, even for all Fx keys (F1 too, but it triggers the browser's help also).
szd is offline   Reply With Quote
Old 07-27-2003, 10:19 AM   #4
chris-sharpe99
New Member
 
Join Date: Jul 2003
Posts: 41
Default

Dunno if it would work but I spose you could try tracing its ascii number. Dunno what that is either so not much help really. Oh well.
chris-sharpe99 is offline   Reply With Quote
Old 07-27-2003, 02:23 PM   #5
Adrenaline
Fire!!
 
Adrenaline's Avatar
 
Join Date: Jul 2003
Location: Texas
Posts: 322
Default

Quote:
(F1 too, but it triggers the browser's help also)
I very sure that you can't do anything about that unless you some how go into the browser and change the command for the F1 key.
Adrenaline is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:41 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.