gamepad.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Copyright 2015 Hajime Hoshi
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package ebiten
  15. import (
  16. "github.com/hajimehoshi/ebiten/v2/internal/gamepad"
  17. "github.com/hajimehoshi/ebiten/v2/internal/gamepaddb"
  18. )
  19. // GamepadButton represents a gamepad button.
  20. type GamepadButton = gamepad.Button
  21. // GamepadButtons
  22. const (
  23. GamepadButton0 GamepadButton = gamepad.Button0
  24. GamepadButton1 GamepadButton = gamepad.Button1
  25. GamepadButton2 GamepadButton = gamepad.Button2
  26. GamepadButton3 GamepadButton = gamepad.Button3
  27. GamepadButton4 GamepadButton = gamepad.Button4
  28. GamepadButton5 GamepadButton = gamepad.Button5
  29. GamepadButton6 GamepadButton = gamepad.Button6
  30. GamepadButton7 GamepadButton = gamepad.Button7
  31. GamepadButton8 GamepadButton = gamepad.Button8
  32. GamepadButton9 GamepadButton = gamepad.Button9
  33. GamepadButton10 GamepadButton = gamepad.Button10
  34. GamepadButton11 GamepadButton = gamepad.Button11
  35. GamepadButton12 GamepadButton = gamepad.Button12
  36. GamepadButton13 GamepadButton = gamepad.Button13
  37. GamepadButton14 GamepadButton = gamepad.Button14
  38. GamepadButton15 GamepadButton = gamepad.Button15
  39. GamepadButton16 GamepadButton = gamepad.Button16
  40. GamepadButton17 GamepadButton = gamepad.Button17
  41. GamepadButton18 GamepadButton = gamepad.Button18
  42. GamepadButton19 GamepadButton = gamepad.Button19
  43. GamepadButton20 GamepadButton = gamepad.Button20
  44. GamepadButton21 GamepadButton = gamepad.Button21
  45. GamepadButton22 GamepadButton = gamepad.Button22
  46. GamepadButton23 GamepadButton = gamepad.Button23
  47. GamepadButton24 GamepadButton = gamepad.Button24
  48. GamepadButton25 GamepadButton = gamepad.Button25
  49. GamepadButton26 GamepadButton = gamepad.Button26
  50. GamepadButton27 GamepadButton = gamepad.Button27
  51. GamepadButton28 GamepadButton = gamepad.Button28
  52. GamepadButton29 GamepadButton = gamepad.Button29
  53. GamepadButton30 GamepadButton = gamepad.Button30
  54. GamepadButton31 GamepadButton = gamepad.Button31
  55. GamepadButtonMax GamepadButton = GamepadButton31
  56. )
  57. // GamepadAxisType represents a gamepad axis.
  58. // This is the same as int for backward compatibility in v2.
  59. type GamepadAxisType = int
  60. // StandardGamepadButton represents a gamepad button in the standard layout.
  61. //
  62. // The layout and the button values are based on the web standard.
  63. // See https://www.w3.org/TR/gamepad/#remapping.
  64. type StandardGamepadButton = gamepaddb.StandardButton
  65. // StandardGamepadButtons
  66. const (
  67. StandardGamepadButtonRightBottom StandardGamepadButton = gamepaddb.StandardButtonRightBottom
  68. StandardGamepadButtonRightRight StandardGamepadButton = gamepaddb.StandardButtonRightRight
  69. StandardGamepadButtonRightLeft StandardGamepadButton = gamepaddb.StandardButtonRightLeft
  70. StandardGamepadButtonRightTop StandardGamepadButton = gamepaddb.StandardButtonRightTop
  71. StandardGamepadButtonFrontTopLeft StandardGamepadButton = gamepaddb.StandardButtonFrontTopLeft
  72. StandardGamepadButtonFrontTopRight StandardGamepadButton = gamepaddb.StandardButtonFrontTopRight
  73. StandardGamepadButtonFrontBottomLeft StandardGamepadButton = gamepaddb.StandardButtonFrontBottomLeft
  74. StandardGamepadButtonFrontBottomRight StandardGamepadButton = gamepaddb.StandardButtonFrontBottomRight
  75. StandardGamepadButtonCenterLeft StandardGamepadButton = gamepaddb.StandardButtonCenterLeft
  76. StandardGamepadButtonCenterRight StandardGamepadButton = gamepaddb.StandardButtonCenterRight
  77. StandardGamepadButtonLeftStick StandardGamepadButton = gamepaddb.StandardButtonLeftStick
  78. StandardGamepadButtonRightStick StandardGamepadButton = gamepaddb.StandardButtonRightStick
  79. StandardGamepadButtonLeftTop StandardGamepadButton = gamepaddb.StandardButtonLeftTop
  80. StandardGamepadButtonLeftBottom StandardGamepadButton = gamepaddb.StandardButtonLeftBottom
  81. StandardGamepadButtonLeftLeft StandardGamepadButton = gamepaddb.StandardButtonLeftLeft
  82. StandardGamepadButtonLeftRight StandardGamepadButton = gamepaddb.StandardButtonLeftRight
  83. StandardGamepadButtonCenterCenter StandardGamepadButton = gamepaddb.StandardButtonCenterCenter
  84. StandardGamepadButtonMax StandardGamepadButton = StandardGamepadButtonCenterCenter
  85. )
  86. // StandardGamepadAxis represents a gamepad axis in the standard layout.
  87. //
  88. // The layout and the button values are based on the web standard.
  89. // See https://www.w3.org/TR/gamepad/#remapping.
  90. type StandardGamepadAxis = gamepaddb.StandardAxis
  91. // StandardGamepadAxes
  92. const (
  93. StandardGamepadAxisLeftStickHorizontal StandardGamepadAxis = gamepaddb.StandardAxisLeftStickHorizontal
  94. StandardGamepadAxisLeftStickVertical StandardGamepadAxis = gamepaddb.StandardAxisLeftStickVertical
  95. StandardGamepadAxisRightStickHorizontal StandardGamepadAxis = gamepaddb.StandardAxisRightStickHorizontal
  96. StandardGamepadAxisRightStickVertical StandardGamepadAxis = gamepaddb.StandardAxisRightStickVertical
  97. StandardGamepadAxisMax StandardGamepadAxis = StandardGamepadAxisRightStickVertical
  98. )