defaultKeybinds.tscript 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. if(!isObject( ExampleMoveMap ) )
  2. {
  3. new ActionMap(ExampleMoveMap)
  4. {
  5. humanReadableName = "Example Movement";
  6. };
  7. }
  8. //------------------------------------------------------------------------------
  9. // Set up remappable entries
  10. //------------------------------------------------------------------------------
  11. addKeyRemap("Forward", "ExampleMoveMap", "keyboard", "moveForward", "Forward Movement");
  12. addKeyRemap("Backward", "ExampleMoveMap", "keyboard", "movebackward", "Backward Movement");
  13. addKeyRemap("Strafe Left", "ExampleMoveMap", "keyboard", "moveleft", "Left Strafing Movement");
  14. addKeyRemap("Strafe Right", "ExampleMoveMap", "keyboard", "moveright", "Right Strafing Movement");
  15. addKeyRemap("Ascend", "ExampleMoveMap", "keyboard", "moveup", "Makes the camera ascend");
  16. addKeyRemap("Descend", "ExampleMoveMap", "keyboard", "movedown", "Makes the camera descend");
  17. addKeyRemap("Jump", "ExampleMoveMap", "keyboard", "jump", "Jump");
  18. //addKeyRemap("Forward", "ExampleMoveMap", "gamepad", "gamePadMoveY", "Forward Movement");
  19. //addKeyRemap("Backward", "ExampleMoveMap", "gamepad", "gamePadMoveY", "Backward Movement");
  20. //addKeyRemap("Strafe Left", "ExampleMoveMap", "gamepad", "gamePadMoveX", "Left Strafing Movement");
  21. //addKeyRemap("Strafe Right", "ExampleMoveMap", "gamepad", "gamePadMoveX", "Right Strafing Movement");
  22. addKeyRemap("Jump", "ExampleMoveMap", "gamepad", "jump", "Jump");
  23. //------------------------------------------------------------------------------
  24. // Non-remapable binds
  25. //------------------------------------------------------------------------------
  26. ExampleMoveMap.bind( keyboard, F2, showPlayerList );
  27. ExampleMoveMap.bind(keyboard, "ctrl h", hideHUDs);
  28. ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless);
  29. ExampleMoveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(GameMenu);");
  30. ExampleMoveMap.bindCmd(gamepad, btn_start, "Canvas.pushDialog(GameMenu);", "" );
  31. //------------------------------------------------------------------------------
  32. // Movement Keys
  33. //------------------------------------------------------------------------------
  34. ExampleMoveMap.bind( keyboard, a, moveleft );
  35. ExampleMoveMap.bind( keyboard, d, moveright );
  36. ExampleMoveMap.bind( keyboard, left, moveleft );
  37. ExampleMoveMap.bind( keyboard, right, moveright );
  38. ExampleMoveMap.bind( keyboard, w, moveforward );
  39. ExampleMoveMap.bind( keyboard, s, movebackward );
  40. ExampleMoveMap.bind( keyboard, up, moveforward );
  41. ExampleMoveMap.bind( keyboard, down, movebackward );
  42. ExampleMoveMap.bind( keyboard, e, moveup );
  43. ExampleMoveMap.bind( keyboard, c, movedown );
  44. ExampleMoveMap.bind( keyboard, space, jump );
  45. ExampleMoveMap.bind( mouse, xaxis, yaw );
  46. ExampleMoveMap.bind( mouse, yaxis, pitch );
  47. ExampleMoveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
  48. ExampleMoveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
  49. ExampleMoveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
  50. ExampleMoveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
  51. ExampleMoveMap.bind( gamepad, btn_a, jump );
  52. ExampleMoveMap.bindCmd( gamepad, btn_back, "disconnect();", "" );
  53. //------------------------------------------------------------------------------
  54. // Demo recording functions
  55. //------------------------------------------------------------------------------
  56. ExampleMoveMap.bind( keyboard, F3, startRecordingDemo );
  57. ExampleMoveMap.bind( keyboard, F4, stopRecordingDemo );
  58. //------------------------------------------------------------------------------
  59. // Helper Functions
  60. //------------------------------------------------------------------------------
  61. GlobalActionMap.bind(keyboard, "ctrl F3", doProfile);
  62. //------------------------------------------------------------------------------
  63. // Misc.
  64. //------------------------------------------------------------------------------
  65. GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
  66. ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");