1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.32 Bug Reporting thread
    Solutions and more information may already be available.

Keyboard remapping

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by MikeHawkIsRaging, Aug 13, 2013.

  1. MikeHawkIsRaging

    MikeHawkIsRaging
    Expand Collapse

    Joined:
    Aug 13, 2013
    Messages:
    3
    How can I remap the keyboard controls for it to use the WASD buttons instead of the up, right, down, left buttons?

    I tried editing the keyboard.inputmap.cs file but it didn't work.

    Anyone knows how to fix this?

    I edited the file like this:
    Code:
    //////////////////////////////////////////////////// Keyboard mappings
    // keyboard
    //moveMap.bind(keyboard, w, accelerate);
    //moveMap.bind(keyboard, s, brake);
    //moveMap.bind(keyboard, a, steer_left);
    //moveMap.bind(keyboard, d, steer_right);
    
    
    moveMap.bind( keyboard, a, moveleft );
    moveMap.bind( keyboard, d, moveright );
    moveMap.bind( keyboard, w, moveforward );
    moveMap.bind( keyboard, s, movebackward );
    
    
    moveMap.bind( keyboard, left, steer_left );
    moveMap.bind( keyboard, right, steer_right );
    moveMap.bind( keyboard, up, accelerate );
    moveMap.bind( keyboard, down, brake );
    
    
    // shifting
    moveMap.bind( keyboard, lshift, clutch );
    moveMap.bind( keyboard, x, shiftUp);
    moveMap.bind( keyboard, z, shiftDown);
    moveMap.bind( keyboard, q, toggleShifterMode );
    
    
    $np_movespeed = 0.1;
    // camera/numpad
    function np_x(%val)
    {
       if(%val > 0)
       {
          $mvYawLeftSpeed = %val * $np_movespeed;
          $mvYawRightSpeed = 0;
       }
       else
       {
          $mvYawLeftSpeed = 0;
          $mvYawRightSpeed = -%val * $np_movespeed;
       }
    }
    function np_y(%val)
    {
       if(%val > 0)
       {
          $mvPitchDownSpeed = %val * $np_movespeed;
          $mvPitchUpSpeed = 0;
       }
       else
       {
          $mvPitchDownSpeed = 0;
          $mvPitchUpSpeed = -%val * $np_movespeed;
       }
    }
    moveMap.bindCmd(keyboard, numpad4, "np_x(-1);", "np_x(0);");
    moveMap.bindCmd(keyboard, numpad6, "np_x(1);", "np_x(0);");
    moveMap.bindCmd(keyboard, numpad8, "np_y(1);", "np_y(0);");
    moveMap.bindCmd(keyboard, numpad2, "np_y(-1);", "np_y(0);");
    moveMap.bindCmd(keyboard, numpad9, "gamepadZoom(-0.1);", "gamepadZoom(0);");
    moveMap.bindCmd(keyboard, numpad3, "gamepadZoom(0.1);", "gamepadZoom(0);");
    moveMap.bindCmd(keyboard, numpad5, "beamNGResetCamera();", "");
    moveMap.bindCmd(keyboard, numpad1, "beamNGCameraLookback();", "");
    moveMap.bindCmd(keyboard, tab,     "beamNGSwitchVehicle(1);", "");
    moveMap.bindCmd(keyboard, "shift tab", "beamNGSwitchVehicle(-1);", "");
    moveMap.bindCmd(keyboard, c,       "beamNGCameraToggle();", "");
    moveMap.bindCmd(keyboard, "ctrl m", "reloadInputMaps();", "" );
    
    
    // assorted
    moveMap.bindCmd(keyboard, i, "beamNGResetPhysics();", "");
    moveMap.bindCmd(keyboard, r, "beamNGResetPhysics();", "");
    moveMap.bindCmd(keyboard, j, "beamNGTogglePhysics();", "");
    moveMap.bind(keyboard, p, parkingbrake_toggle);
    moveMap.bindCmd(keyboard, "ctrl r", "beamNGReloadCurrentVehicle();", "");
    moveMap.bindCmd(keyboard, "shift t", "beamNGReloadSystemLua();", "");
    moveMap.bindSLuaCmd(keyboard, "ctrl t", "showAIGUI()", "");
    
    
    moveMap.bindCmd(keyboard, "ctrl e", "Canvas.pushDialog(VehicleChooser);", "");
    moveMap.bindVLuaCmd(keyboard, "ctrl w", "partmgmt.showGUI()", "");
    
    
    
    
    moveMap.bindCmd(keyboard, "ctrl escape", "quit();", "" );
    moveMap.bindCmd(keyboard, "escape", "", "handleEscape();");
    
    
    // some toolkit functions
    moveMap.bindVLuaCmd(keyboard, "k", "bdebug.setMode('-1')", "");
    moveMap.bindVLuaCmd(keyboard, "ctrl k", "bdebug.toggleMeshAlpha(-1)", "");
    moveMap.bindVLuaCmd(keyboard, "l", "bdebug.setMode('+1')", "");
    moveMap.bindVLuaCmd(keyboard, "ctrl l", "bdebug.toggleMeshAlpha(1)", "");
    
    
    
    
    moveMap.bindVLuaCmd(keyboard, "comma", "electrics.toggle_left_signal()", "");
    moveMap.bindVLuaCmd(keyboard, "period", "electrics.toggle_right_signal()", "");
    moveMap.bindVLuaCmd(keyboard, "slash", "electrics.toggle_warn_signal()", "");
    moveMap.bindVLuaCmd(keyboard, "n", "electrics.toggle_lights()", "");
    moveMap.bindVLuaCmd(keyboard, "shift b", "input.toggleDynamicSteering()", "");
    
    
    
    
    moveMap.bindCmd(keyboard, "f1", "BeamNGHelp.toggle();", "");
    
    
    moveMap.bindVLuaCmd(keyboard, "alt f1", "bdebug.setMode(0)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f1", "bdebug.setMode(1)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f2", "bdebug.setMode(2)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f3", "bdebug.setMode(3)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f4", "bdebug.setMode(4)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f5", "bdebug.setMode(5)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f6", "bdebug.setMode(6)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f7", "bdebug.setMode(7)", "");
    moveMap.bindVLuaCmd(keyboard, "shift f8", "bdebug.setMode(8)", "");
    
    
    moveMap.bindVLuaCmd(keyboard, "alt left", "bullettime.set('-20')", "");
    moveMap.bindVLuaCmd(keyboard, "alt right", "bullettime.set('+20')", "");
    moveMap.bindVLuaCmd(keyboard, "alt up", "bullettime.set(100)", "");
    moveMap.bindVLuaCmd(keyboard, "alt down", "bullettime.set(5)", "");
    
    
    
     
  2. Deewad

    Deewad
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    240
    Code:
    // keyboard
    //moveMap.bind(keyboard, w, accelerate);
     //moveMap.bind(keyboard, s, brake);
     //moveMap.bind(keyboard, a, steer_left);
     //moveMap.bind(keyboard, d, steer_right);
    Instead of that do this
    Code:
    moveMap.bind(keyboard, w, accelerate);
     moveMap.bind(keyboard, s, brake);
     moveMap.bind(keyboard, a, steer_left);
     moveMap.bind(keyboard, d, steer_right);
    The // Comments it out, So it doesn't read it. For example
    Code:
    // This comment line will be ignored
    // This second line will also be ignored
    %testVariable = 3;
    // This third line will also be ignored
    
    To learn more about torquescript please visit http://www.garagegames.com/products/torque-3d/guides
     
    #2 Deewad, Aug 13, 2013
    Last edited: Aug 13, 2013
  3. MikeHawkIsRaging

    MikeHawkIsRaging
    Expand Collapse

    Joined:
    Aug 13, 2013
    Messages:
    3
    Ah, thank you.

    Edit: Now I edited that in the file and I tested it out, the car won't drive forward when I hit W or up.
     
    #3 MikeHawkIsRaging, Aug 13, 2013
    Last edited: Aug 13, 2013
  4. AbesMapper

    AbesMapper
    Expand Collapse

    Joined:
    Jul 1, 2013
    Messages:
    64
    Copy this from code below and replace with your inputmap (but don't replace all lines!):
    Code:
    //////////////////////////////////////////////////// Keyboard mappings// keyboard
    //moveMap.bind(keyboard, w, accelerate);
    //moveMap.bind(keyboard, s, brake);
    //moveMap.bind(keyboard, a, steer_left);
    //moveMap.bind(keyboard, d, steer_right);
    
    moveMap.bind( keyboard, left, moveleft );
    moveMap.bind( keyboard, right, moveright );
    moveMap.bind( keyboard, up, moveforward );
    moveMap.bind( keyboard, down, movebackward );
    
    moveMap.bind( keyboard, a, steer_left );
    moveMap.bind( keyboard, d, steer_right );
    moveMap.bind( keyboard, w, accelerate );
    moveMap.bind( keyboard, s, brake );
    Restart game and it should work.
     
    #4 AbesMapper, Aug 13, 2013
    Last edited: Aug 13, 2013
  5. MikeHawkIsRaging

    MikeHawkIsRaging
    Expand Collapse

    Joined:
    Aug 13, 2013
    Messages:
    3
    It worked! thanks man, I REALLY appreciate it!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice