ctrl in IE

Right i need to know is it possible to use the ctrl key as part of a key combination , Ctrl + P for example, when a flash movie is loaded into IE. I know all about Keydown and all that stuff

The problem is IE regeristering the key press and its short cut to print the page

How do i disable the IE shortcuts or interpurt them before going to IE

this is a big one please help
jockmahon01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh ChopraCommented:
yes, it is possible,
following code will do the trick:

//-----------------------
var keyListener = new Object();
keyListener.onKeyUp = function() {
      if (Key.isDown(Key.CONTROL) && Key.getCode() == 80) {
            // 80 is the keycode for P
            trace("CTRL+P pressed");
      }
};
Key.addListener(keyListener);
//----------------

IMPORTANT: To test above code in Flash authoring environment you must have to select  "Disabled Keyboard Shortcuts"  menu item in Options menu on Compiled SWF window
0
jockmahon01Author Commented:
I know of this code, Have u deployed this to a html/cfm file and browsed to it in IE , because i think ull find that ctrl + P will open the print dialog
0
Aneesh ChopraCommented:
if SWF in html has the focus then CTRL+P will trigger the actionscript code..

to test it, click on SWF first then press CTRL+P
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jockmahon01Author Commented:
Incorrect, CTRL+P still invokes the print dialog, if u wan to upload an example to prove ur case i will have a look
0
Aneesh ChopraCommented:
sorry,
I agree, Flash can't overide Browser default PRINT shortcut key..

but yes, you can use CTRL+ <any unassigned key> with in flash and it will work fine..
0
jockmahon01Author Commented:

i also agree with this, the problem with that however is as soon as mircosoft release a new version of IE with new shortcuts ur application could suddenly and overnight be in big problems


What i have discovered for all thoes who struggle with this problem is that you can get the above code to work ie Ctrl+ P to work in a browser.
If u specify to ur users that they must press shitf as well then IE wont pick up the ctrl+p but flash will

so

set up a key listener

            keyListener = new Object();
      keyListener.onKeyDown = Delegate.create(this, keyDownListener);
      Key.addListener(keyListener);


private function keyDownListener():Void
{
      if( (Key.getCode() == 80 ) && ( Key.isDown(Key.CONTROL) )   )
      {
                        trace("Im executing");
            return;
      }
}


if the user presses Shift+ctrl+p then IE will NOT open the print dialog but flash will execute this code
Its not the best solution in the world but the only one i can come up with
                  
0
blue-genieCommented:
i remember a number of years ago, this was an issue, and some keys just can't be caught, like the F keys. and a client demanded it, and i had to tell them no can do - also had to convince them to accept a different sequence.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jockmahon01Author Commented:
one way around this is to include shift, so ctrl + shift + p. With shift pressed ie is intelligent enough to know that ur not pressing ctrl + p and doesnt open the print dialog, flash is not and will kick off what ever u coded to happen with ctrl and p down
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.