default.keybinds.cs 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. if ( isObject( moveMap ) )
  23. moveMap.delete();
  24. new ActionMap(moveMap);
  25. //------------------------------------------------------------------------------
  26. // Non-remapable binds
  27. //------------------------------------------------------------------------------
  28. moveMap.bind( keyboard, F2, showPlayerList );
  29. moveMap.bind(keyboard, "ctrl h", hideHUDs);
  30. moveMap.bind(keyboard, "alt p", doScreenShotHudless);
  31. moveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);");
  32. //------------------------------------------------------------------------------
  33. // Movement Keys
  34. //------------------------------------------------------------------------------
  35. moveMap.bind( keyboard, a, moveleft );
  36. moveMap.bind( keyboard, d, moveright );
  37. moveMap.bind( keyboard, left, moveleft );
  38. moveMap.bind( keyboard, right, moveright );
  39. moveMap.bind( keyboard, w, moveforward );
  40. moveMap.bind( keyboard, s, movebackward );
  41. moveMap.bind( keyboard, up, moveforward );
  42. moveMap.bind( keyboard, down, movebackward );
  43. moveMap.bind( keyboard, e, moveup );
  44. moveMap.bind( keyboard, c, movedown );
  45. moveMap.bind( keyboard, space, jump );
  46. moveMap.bind( mouse, xaxis, yaw );
  47. moveMap.bind( mouse, yaxis, pitch );
  48. moveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
  49. moveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
  50. moveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
  51. moveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
  52. moveMap.bind( gamepad, btn_a, jump );
  53. moveMap.bindCmd( gamepad, btn_back, "disconnect();", "" );
  54. moveMap.bindCmd(gamepad, dpadl, "toggleLightColorViz();", "");
  55. moveMap.bindCmd(gamepad, dpadu, "toggleDepthViz();", "");
  56. moveMap.bindCmd(gamepad, dpadd, "toggleNormalsViz();", "");
  57. moveMap.bindCmd(gamepad, dpadr, "toggleLightSpecularViz();", "");
  58. // ----------------------------------------------------------------------------
  59. // Stance/pose
  60. // ----------------------------------------------------------------------------
  61. moveMap.bind(keyboard, lcontrol, doCrouch);
  62. moveMap.bind(gamepad, btn_b, doCrouch);
  63. moveMap.bind(keyboard, lshift, doSprint);
  64. //------------------------------------------------------------------------------
  65. // Mouse Trigger
  66. //------------------------------------------------------------------------------
  67. //function altTrigger(%val)
  68. //{
  69. //$mvTriggerCount1++;
  70. //}
  71. moveMap.bind( mouse, button0, mouseFire );
  72. //moveMap.bind( mouse, button1, altTrigger );
  73. //------------------------------------------------------------------------------
  74. // Gamepad Trigger
  75. //------------------------------------------------------------------------------
  76. moveMap.bind(gamepad, triggerr, gamepadFire);
  77. moveMap.bind(gamepad, triggerl, gamepadAltTrigger);
  78. //------------------------------------------------------------------------------
  79. // Zoom and FOV functions
  80. //------------------------------------------------------------------------------
  81. if($Player::CurrentFOV $= "")
  82. $Player::CurrentFOV = $pref::Player::DefaultFOV / 2;
  83. // toggleZoomFOV() works by dividing the CurrentFOV by 2. Each time that this
  84. // toggle is hit it simply divides the CurrentFOV by 2 once again. If the
  85. // FOV is reduced below a certain threshold then it resets to equal half of the
  86. // DefaultFOV value. This gives us 4 zoom levels to cycle through.
  87. moveMap.bind(keyboard, f, setZoomFOV); // f for field of view
  88. moveMap.bind(keyboard, z, toggleZoom); // z for zoom
  89. moveMap.bind( mouse, button1, mouseButtonZoom );
  90. //------------------------------------------------------------------------------
  91. // Camera & View functions
  92. //------------------------------------------------------------------------------
  93. moveMap.bind( keyboard, v, toggleFreeLook ); // v for vanity
  94. moveMap.bind(keyboard, tab, toggleFirstPerson );
  95. moveMap.bind( gamepad, btn_x, toggleFirstPerson );
  96. // ----------------------------------------------------------------------------
  97. // Misc. Player stuff
  98. // ----------------------------------------------------------------------------
  99. // Gideon does not have these animations, so the player does not need access to
  100. // them. Commenting instead of removing so as to retain an example for those
  101. // who will want to use a player model that has these animations and wishes to
  102. // use them.
  103. //moveMap.bindCmd(keyboard, "ctrl w", "commandToServer('playCel',\"wave\");", "");
  104. //moveMap.bindCmd(keyboard, "ctrl s", "commandToServer('playCel',\"salute\");", "");
  105. moveMap.bindCmd(keyboard, "ctrl k", "commandToServer('suicide');", "");
  106. //------------------------------------------------------------------------------
  107. // Item manipulation
  108. //------------------------------------------------------------------------------
  109. moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Ryder\");", "");
  110. moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"Lurker\");", "");
  111. moveMap.bindCmd(keyboard, "3", "commandToServer('use',\"LurkerGrenadeLauncher\");", "");
  112. moveMap.bindCmd(keyboard, "4", "commandToServer('use',\"ProxMine\");", "");
  113. moveMap.bindCmd(keyboard, "5", "commandToServer('use',\"DeployableTurret\");", "");
  114. moveMap.bindCmd(keyboard, "r", "commandToServer('reloadWeapon');", "");
  115. moveMap.bind(keyboard, 0, unmountWeapon);
  116. moveMap.bind(keyboard, "alt w", throwWeapon);
  117. moveMap.bind(keyboard, "alt a", tossAmmo);
  118. moveMap.bind(keyboard, q, nextWeapon);
  119. moveMap.bind(keyboard, "ctrl q", prevWeapon);
  120. moveMap.bind(mouse, "zaxis", mouseWheelWeaponCycle);
  121. //------------------------------------------------------------------------------
  122. // Message HUD functions
  123. //------------------------------------------------------------------------------
  124. moveMap.bind(keyboard, u, toggleMessageHud );
  125. //moveMap.bind(keyboard, y, teamMessageHud );
  126. moveMap.bind(keyboard, "pageUp", pageMessageHudUp );
  127. moveMap.bind(keyboard, "pageDown", pageMessageHudDown );
  128. moveMap.bind(keyboard, "p", resizeMessageHud );
  129. //------------------------------------------------------------------------------
  130. // Demo recording functions
  131. //------------------------------------------------------------------------------
  132. moveMap.bind( keyboard, F3, startRecordingDemo );
  133. moveMap.bind( keyboard, F4, stopRecordingDemo );
  134. //------------------------------------------------------------------------------
  135. // Helper Functions
  136. //------------------------------------------------------------------------------
  137. moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
  138. moveMap.bind(keyboard, "F7", dropPlayerAtCamera);
  139. GlobalActionMap.bind(keyboard, "ctrl F3", doProfile);
  140. //------------------------------------------------------------------------------
  141. // Misc.
  142. //------------------------------------------------------------------------------
  143. GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
  144. GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
  145. GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();");
  146. GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
  147. moveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");
  148. // ----------------------------------------------------------------------------
  149. // Useful vehicle stuff
  150. // ----------------------------------------------------------------------------
  151. // Bind the keys to the carjack command
  152. moveMap.bindCmd(keyboard, "ctrl z", "carjack();", "");
  153. // Starting vehicle action map code
  154. if ( isObject( vehicleMap ) )
  155. vehicleMap.delete();
  156. new ActionMap(vehicleMap);
  157. //------------------------------------------------------------------------------
  158. // Non-remapable binds
  159. //------------------------------------------------------------------------------
  160. vehicleMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);");
  161. // The key command for flipping the car
  162. vehicleMap.bindCmd(keyboard, "ctrl x", "commandToServer(\'flipCar\');", "");
  163. vehicleMap.bind( keyboard, w, moveforward );
  164. vehicleMap.bind( keyboard, s, movebackward );
  165. vehicleMap.bind( keyboard, up, moveforward );
  166. vehicleMap.bind( keyboard, down, movebackward );
  167. vehicleMap.bind( mouse, xaxis, yaw );
  168. vehicleMap.bind( mouse, yaxis, pitch );
  169. vehicleMap.bind( mouse, button0, mouseFire );
  170. vehicleMap.bind( mouse, button1, altTrigger );
  171. vehicleMap.bindCmd(keyboard, "f","getout();","");
  172. vehicleMap.bind(keyboard, space, brake);
  173. vehicleMap.bindCmd(keyboard, "l", "brakeLights();", "");
  174. vehicleMap.bind( keyboard, v, toggleFreeLook ); // v for vanity
  175. //vehicleMap.bind(keyboard, tab, toggleFirstPerson );
  176. // bind the left thumbstick for steering
  177. vehicleMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamepadYaw );
  178. // bind the gas, break, and reverse buttons
  179. vehicleMap.bind( gamepad, btn_a, moveforward );
  180. vehicleMap.bind( gamepad, btn_b, brake );
  181. vehicleMap.bind( gamepad, btn_x, movebackward );
  182. // bind exiting the vehicle to a button
  183. vehicleMap.bindCmd(gamepad, btn_y,"getout();","");