UE2 - UT2kX How to get key bound to something?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

ROSoldier

New Member
Feb 1, 2015
29
0
1
Hello. I would like to know how can I get the Key that is bound to a function, lets say Jump();

Basically the reverse of 'get input Space'.

Thanx in advance!
 
Last edited:

ROSoldier

New Member
Feb 1, 2015
29
0
1
Hello everyone I found a solution on my own.
I made a simple function that will check if a key is bound to something, and if so, will return 'true':

Code:
function bool CheckKeyIsBound(string Key, string ExecFunctionName)
{
     local string TestString, KeyString;
    TestString = ConsoleCommand("get input " $KeyString);
    if( ExecFunctionName ~= TestString )
   {
        return true;
    }

    return false;
}

Basically what this function does is: you give it a Key (for example "SPACE", and a command (in this case an exec(), for example Jump(),
and if the "Space" key is bound to Jump(), the function will return true. If else, the function will return false.

Of course, if you want to check multiple keys, you have to run the function multiple times or make a simple loop.
Hope this will be useful.