default.keybinds.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. $RemapName[$RemapCount] = "Forward";
  23. $RemapCmd[$RemapCount] = "moveforward";
  24. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  25. $RemapDevice[$RemapCount] = "keyboard";
  26. $RemapDescription[$RemapCount] = "Forward Movement";
  27. $RemapCount++;
  28. $RemapName[$RemapCount] = "Backward";
  29. $RemapCmd[$RemapCount] = "movebackward";
  30. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  31. $RemapDevice[$RemapCount] = "keyboard";
  32. $RemapDescription[$RemapCount] = "Backward Movement";
  33. $RemapCount++;
  34. $RemapName[$RemapCount] = "Strafe Left";
  35. $RemapCmd[$RemapCount] = "moveleft";
  36. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  37. $RemapDevice[$RemapCount] = "keyboard";
  38. $RemapDescription[$RemapCount] = "Left Strafing Movement";
  39. $RemapCount++;
  40. $RemapName[$RemapCount] = "Strafe Right";
  41. $RemapCmd[$RemapCount] = "moveright";
  42. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  43. $RemapDevice[$RemapCount] = "keyboard";
  44. $RemapDescription[$RemapCount] = "Right Strafing Movement";
  45. $RemapCount++;
  46. $RemapName[$RemapCount] = "Ascend";
  47. $RemapCmd[$RemapCount] = "moveup";
  48. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  49. $RemapDevice[$RemapCount] = "keyboard";
  50. $RemapDescription[$RemapCount] = "Makes the camera ascend";
  51. $RemapCount++;
  52. $RemapName[$RemapCount] = "Descend";
  53. $RemapCmd[$RemapCount] = "movedown";
  54. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  55. $RemapDevice[$RemapCount] = "keyboard";
  56. $RemapDescription[$RemapCount] = "Makes the camera descend";
  57. $RemapCount++;
  58. $RemapName[$RemapCount] = "Jump";
  59. $RemapCmd[$RemapCount] = "jump";
  60. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  61. $RemapDevice[$RemapCount] = "keyboard";
  62. $RemapDescription[$RemapCount] = "Jump";
  63. $RemapCount++;
  64. $RemapName[$RemapCount] = "Ascend";
  65. $RemapCmd[$RemapCount] = "moveup";
  66. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  67. $RemapDevice[$RemapCount] = "gamepad";
  68. $RemapDescription[$RemapCount] = "Makes the camera ascend";
  69. $RemapCount++;
  70. $RemapName[$RemapCount] = "Descend";
  71. $RemapCmd[$RemapCount] = "movedown";
  72. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  73. $RemapDevice[$RemapCount] = "gamepad";
  74. $RemapDescription[$RemapCount] = "Makes the camera descend";
  75. $RemapCount++;
  76. $RemapName[$RemapCount] = "Jump";
  77. $RemapCmd[$RemapCount] = "jump";
  78. $RemapActionMap[$RemapCount] = "ExampleMoveMap";
  79. $RemapDevice[$RemapCount] = "gamepad";
  80. $RemapDescription[$RemapCount] = "Jump";
  81. $RemapCount++;
  82. if ( isObject( ExampleMoveMap ) )
  83. ExampleMoveMap.delete();
  84. new ActionMap(ExampleMoveMap);
  85. ExampleMoveMap.humanReadableName = "Example Movement";
  86. //------------------------------------------------------------------------------
  87. // Non-remapable binds
  88. //------------------------------------------------------------------------------
  89. ExampleMoveMap.bind( keyboard, F2, showPlayerList );
  90. ExampleMoveMap.bind(keyboard, "ctrl h", hideHUDs);
  91. ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless);
  92. function openPauseMenu(%val)
  93. {
  94. if(%val && PauseMenu.isAwake() == false)
  95. {
  96. echo("PUSHING PAUSE MENU");
  97. Canvas.pushDialog(PauseMenu);
  98. }
  99. }
  100. ExampleMoveMap.bind(keyboard, "escape", openPauseMenu);
  101. //------------------------------------------------------------------------------
  102. // Movement Keys
  103. //------------------------------------------------------------------------------
  104. ExampleMoveMap.bind( keyboard, a, moveleft );
  105. ExampleMoveMap.bind( keyboard, d, moveright );
  106. ExampleMoveMap.bind( keyboard, left, moveleft );
  107. ExampleMoveMap.bind( keyboard, right, moveright );
  108. ExampleMoveMap.bind( keyboard, w, moveforward );
  109. ExampleMoveMap.bind( keyboard, s, movebackward );
  110. ExampleMoveMap.bind( keyboard, up, moveforward );
  111. ExampleMoveMap.bind( keyboard, down, movebackward );
  112. ExampleMoveMap.bind( keyboard, e, moveup );
  113. ExampleMoveMap.bind( keyboard, c, movedown );
  114. ExampleMoveMap.bind( keyboard, space, jump );
  115. ExampleMoveMap.bind( mouse, xaxis, yaw );
  116. ExampleMoveMap.bind( mouse, yaxis, pitch );
  117. ExampleMoveMap.bind( gamepad, rxaxis, "D", "-0.23 0.23", gamepadYaw );
  118. ExampleMoveMap.bind( gamepad, ryaxis, "D", "-0.23 0.23", gamepadPitch );
  119. ExampleMoveMap.bind( gamepad, xaxis, "D", "-0.23 0.23", gamePadMoveX );
  120. ExampleMoveMap.bind( gamepad, yaxis, "D", "-0.23 0.23", gamePadMoveY );
  121. ExampleMoveMap.bind( gamepad, btn_a, jump );
  122. ExampleMoveMap.bind( gamepad, btn_x, moveup );
  123. ExampleMoveMap.bind( gamepad, btn_y, movedown );
  124. ExampleMoveMap.bindCmd( gamepad, btn_start, "Canvas.pushDialog(PauseMenu);", "" );
  125. //------------------------------------------------------------------------------
  126. // Misc.
  127. //------------------------------------------------------------------------------
  128. GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
  129. GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
  130. GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.toggleFullscreen();");
  131. GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
  132. ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", "");