2 Replies Latest reply on Jun 11, 2006 1:34 PM by Crandom

    Can't detect control-a

    David_Fostor Level 1

      Is there any way to detect when control-a or control-c is pressed (that is, hold down control key, press A key). The following code to detect a control-7 works fine:

      function myOnKeyDown() {
      // 55 is key code for 7
      if (Key.isDown(Key.CONTROL) && Key.getCode() == 55) {
      Selection.setFocus(my_btn);
      my_btn.onPress();
      }
      }

      but if you change it to "== 65", it never fires. I've also found if I collect and log all keystrokes with an onKeyDown listener, the control keys (code 17) always register, but the following letter never does.

      Help! Thanks!

      David


      p.s. no, I don't think this is a Disable Keyboard Shortcuts issue. The same problem occurs whether I'm in the flash environment or in a browser.
        • 1. Re: Can't detect control-a
          Level 7


          David Fostor wrote:
          > Is there any way to detect when control-a or control-c is pressed (that is,
          > hold down control key, press A key). The following code to detect a control-7
          > works fine:
          >
          > function myOnKeyDown() {
          > // 55 is key code for 7
          > if (Key.isDown(Key.CONTROL) && Key.getCode() == 55) {
          > Selection.setFocus(my_btn);
          > my_btn.onPress();
          > }
          > }
          >
          > but if you change it to "== 65", it never fires. I've also found if I collect
          > and log all keystrokes with an onKeyDown listener, the control keys (code 17)
          > always register, but the following letter never does.
          >
          > Help! Thanks!
          >
          > David
          >
          >
          > p.s. no, I don't think this is a Disable Keyboard Shortcuts issue. The same
          > problem occurs whether I'm in the flash environment or in a browser.
          >

          The problem could be that you use THE MOST standard short cuts which in every application
          there is out there, are use for Select All and Copy. Perhaps the program simply has priority
          when comes to these key and you can't force it to overwrite these preferences.

          I had a client while back who needed software simulation and all the function key to work,
          like F1 etc... We did manage to fix that on one machine but whoever else run that, F1 would
          bring Help files, if not browser than windows so you could get it to work on some machine but
          not all. Perhaps new set of key combo you could consider.



          --
          Regards

          Urami


          --



          Happy New Year guys - all the best there is in the 2006 :)




          <urami>
          http://www.Flashfugitive.com
          </urami>

          <web junk free>
          http://www.firefox.com
          </web junk free>
          • 2. Re: Can't detect control-a
            Crandom
            you are already pressing down a key, so it is still in the function. the function is being already used, so the following letter cannot register.