3 Replies Latest reply on Dec 14, 2011 9:24 AM by Arsen Bandurian

    Keys Remapping

    Arsen Bandurian

      Hello. From the Help file I learned how to remap a key using the keyCapture.remap property.

       

      If, say, I want to remap a key temporarily (i.e. on just one screen on my app) and then return it to the original value, how do I do it? The help file says you can't remap the key to itself as RhoE will hang.

       

      Thanks.

        • Re: Keys Remapping
          Benedict Kennedy

          If you only need to have the key remapped on one page, RhoElements will reset the key back to its default when you navigate to a new page.

           

          If you need to clear the remap on the same page, you can call keyEvent with an empty string:

          /**
           * This remaps the 2 key to the 3 key
           */
          function callKeyRemap()
          {
               keyCapture.keyValue = "0x32"; // "2" key
               keyCapture.remap = "0x33"; // "3" key
          }
          
          /**
           * This clears the remap that was on the "2" key
           */
          function clearKeyRemap()
          {
               keyCapture.keyValue = "0x32";
               keyCapture.keyEvent = "";
          }
          

           

          This works because remap and keyEvent are mutually exclusive.

           

          I hope this helps,

           

          Ben

            • Re: Keys Remapping
              Arsen Bandurian

              Here's what I do (snippets):

               

               

                 

               

              <HTML>

              <HEAD>

              <META HTTP-Equiv="KeyCapture" Content="KeyValue:0x6A; Dispatch:False; Remap:0x09">

              </HEAD>

               

              <BODY>

              <input type=button value="Key Remap Disable" onClick="fnKeysDisable();">

              <input type=button value="Key Remap Re-Enable" onClick="fnKeysEnable();">

              </BODY>

               

               

              <SCRIPT>

              function fnKeysDisable() {

              alert ('!');

              keyCapture.keyValue = 0x6A;  keyCapture.keyEvent = url('');

              }

               

              function fnKeysEnable() { //Remap Down Key to TAB key

              keyCapture.keyValue = 0x6A;  keyCapture.Remap = 0x09;

              }

              </SCRIPT>

              </HTML>

              Not working. What am I doing wrong?