2 Replies Latest reply on Feb 25, 2013 9:27 PM by Pramod K Shanbhag

    Control Symbol through keycode

    Pramod K Shanbhag Level 1

      Hi

       

      I want to control Symbol through keycode (keyboard shortcuts in Javascript)

      anybody knows pls help me on this

       

      Thanks,

      Pramod

        • 1. Re: Control Symbol through keycode
          TimJaramillo Level 4

          Hi there, keycode functionality is not built into Edge, but since Edge runs on javascript, you can use regular javascript to listen to the user's keyboard inputs, then you can compare those inputs to whatever keyCodes you want, and within a switch statement react accordingly.

           

          Below is an example, using jQuery.

           

          Example:

          http://www.timjaramillo.com/code/edge/keyCodes/

           

          Source:

          www.timjaramillo.com/code/edge/_source/keyCodes.zip

           

           

          Code on Stage.compositionReady:

           

          $(document).keydown(

                    function(e) {

                              // prevent any default actions

                              e.preventDefault();

           

             // test- show keycode in text

                              sym.$("test").html('keyCode: '+e.keyCode);

           

                              switch( e.keyCode ) {

           

                                        // example: handle arrow keys

                                        case 37:

                                                  //

                                                  break;

           

                                        case 38:

                                                  //

                                                  break;

           

                                        case 39:

                                                  //

                                                  break;

           

                                        case 40:

                                                  //

                                                  break;

                              }

           

                    }

          );

          • 2. Re: Control Symbol through keycode
            Pramod K Shanbhag Level 1

            Thanks for the replay.

            I appreciate your help

             

            Thanks,

            Pramod