Keys Remapping

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.

Anonymous (not verified)
If you only need to have the

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

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Arsen Bandurian
Here's what I do (snippets): 

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?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robin West
ok, found it. Instead of url(

ok, found it. Instead of url('') should just write "".

That was copy-pasted from the help file

Thanks, will continue experimenting.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments