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.

Edit keyboard controls?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by AnnoyingIB, Aug 4, 2013.

  1. AnnoyingIB

    AnnoyingIB
    Expand Collapse

    Joined:
    Sep 9, 2012
    Messages:
    42
    Is it possible to edit the controls on a keyboard? Because I want to change to not having the mouse reversed and drive with WASD

    I have the alpha if it makes any difference, but I don't think it should.
     
  2. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,653
    You should be able to edit keyboard.inputmap.cs in a text editor (found in \scripts\client\inputmaps)

    Hopefully it's somewhat easy to figure out, as it's not well-documented yet in the wiki.
     
  3. AnnoyingIB

    AnnoyingIB
    Expand Collapse

    Joined:
    Sep 9, 2012
    Messages:
    42
    Thanks gabe! Though I didn't find anything related to the reverse mouse thingy...? Is it possible?

    So for everyone else, this is what I have for driving with wasd:
    Code:
    moveMap.bind( keyboard, a, steer_left );
    moveMap.bind( keyboard, d, steer_right );
    moveMap.bind( keyboard, w, accelerate );
    moveMap.bind( keyboard, s, brake );
     
  4. Slyfox

    Slyfox
    Expand Collapse

    Joined:
    Aug 24, 2013
    Messages:
    1
    So this will fix the EXTERNAL camera only. It does break all the other camera modes. Also this has WASD as your control scheme. Cheers

    ////////////////////////////////////////////////
    //// Keyboard mappings
    // arrows
    //moveMap.bind(keyboard, up, accelerate);
    //moveMap.bind(keyboard, down, brake);
    //moveMap.bind(keyboard, left, steer_left);
    //moveMap.bind(keyboard, right, 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, a, steer_left );
    moveMap.bind( keyboard, d, steer_right );
    moveMap.bind( keyboard, w, accelerate );
    moveMap.bind( keyboard, s, 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)", "");


     
  5. HexagonalKahn

    HexagonalKahn
    Expand Collapse

    Joined:
    Aug 24, 2013
    Messages:
    3
    Really helpful thx.:)
     
  6. Dirtbikr98

    Dirtbikr98
    Expand Collapse

    Joined:
    Mar 8, 2013
    Messages:
    68
    Is there a way to get the original keyboard.inputmap.cs file because I tried to change mine to that camera thing posted but I don't want it now and (stupid me) didn't buck up the file.
     
  7. simon48

    simon48
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    203
    Run the updater, it will overwrite any changed base files.

    Just a tip, but in the future put custom inputmaps in a new folder called "custom" inside the "inputmaps" folder. BeamNG will use inputmaps in there first so you don't have to overwrite any inputmaps. Also the updater won't overwrite this folder.
     
  8. The Doctor4

    The Doctor4
    Expand Collapse

    Joined:
    Jun 12, 2016
    Messages:
    1
    I can't find the scripts file.
     
  9. Taza

    Taza
    Expand Collapse

    Joined:
    Nov 8, 2015
    Messages:
    1,335
    This thread was created in 2013 and the information listed above does not hold true anymore. If you want to edit controls just press escape and click on 'Controls'.
     
    • Agree Agree x 3
  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