2 Replies Latest reply on Sep 8, 2011 10:40 AM by dacaglSAS

    Key event fails on Italian keyboard

    dacaglSAS Level 1

      We are currently using Flex 3.2 but are migrating to 4.1 soon.  In my code I'm trying to launch a dialog when the user presses "Ctrl + /" or "Ctrl + Shift + ?" but it is failing on an Italian keyboard.  I suspect the problem is that the '191' keyCode does not match the '/' key on an Italian keyboard.  Anyone have any ideas?

       

      Here is my code:

       

        private function onKeyUp(event:KeyboardEvent):void
        {
         // S0705443 - Add Keyboard shortcut for HelpPopup
         if ( this.visible && event.ctrlKey ) // S0724327 - Only try to display the HelpPopup if it is visible
         {
          if ( event.keyCode == 191 ) // Ctrl + /
          {
           dispatchEvent(new MouseEvent(MouseEvent.CLICK)); // Make it behave like a Mouse click
           event.stopPropagation();
          }
          else if ( event.shiftKey )
          {
           if ( event.keyCode == 191 ) // Ctrl + Shift + / or Ctrl + Shift + ?
           {
            dispatchEvent(new MouseEvent(MouseEvent.CLICK)); // Make it behave like a Mouse click
            event.stopPropagation();
           }
          }
         }
        }