gamepad.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/driver"
  17. )
  18. // GamepadButton represents a gamepad button.
  19. type GamepadButton = driver.GamepadButton
  20. // GamepadButtons
  21. const (
  22. GamepadButton0 GamepadButton = driver.GamepadButton0
  23. GamepadButton1 GamepadButton = driver.GamepadButton1
  24. GamepadButton2 GamepadButton = driver.GamepadButton2
  25. GamepadButton3 GamepadButton = driver.GamepadButton3
  26. GamepadButton4 GamepadButton = driver.GamepadButton4
  27. GamepadButton5 GamepadButton = driver.GamepadButton5
  28. GamepadButton6 GamepadButton = driver.GamepadButton6
  29. GamepadButton7 GamepadButton = driver.GamepadButton7
  30. GamepadButton8 GamepadButton = driver.GamepadButton8
  31. GamepadButton9 GamepadButton = driver.GamepadButton9
  32. GamepadButton10 GamepadButton = driver.GamepadButton10
  33. GamepadButton11 GamepadButton = driver.GamepadButton11
  34. GamepadButton12 GamepadButton = driver.GamepadButton12
  35. GamepadButton13 GamepadButton = driver.GamepadButton13
  36. GamepadButton14 GamepadButton = driver.GamepadButton14
  37. GamepadButton15 GamepadButton = driver.GamepadButton15
  38. GamepadButton16 GamepadButton = driver.GamepadButton16
  39. GamepadButton17 GamepadButton = driver.GamepadButton17
  40. GamepadButton18 GamepadButton = driver.GamepadButton18
  41. GamepadButton19 GamepadButton = driver.GamepadButton19
  42. GamepadButton20 GamepadButton = driver.GamepadButton20
  43. GamepadButton21 GamepadButton = driver.GamepadButton21
  44. GamepadButton22 GamepadButton = driver.GamepadButton22
  45. GamepadButton23 GamepadButton = driver.GamepadButton23
  46. GamepadButton24 GamepadButton = driver.GamepadButton24
  47. GamepadButton25 GamepadButton = driver.GamepadButton25
  48. GamepadButton26 GamepadButton = driver.GamepadButton26
  49. GamepadButton27 GamepadButton = driver.GamepadButton27
  50. GamepadButton28 GamepadButton = driver.GamepadButton28
  51. GamepadButton29 GamepadButton = driver.GamepadButton29
  52. GamepadButton30 GamepadButton = driver.GamepadButton30
  53. GamepadButton31 GamepadButton = driver.GamepadButton31
  54. GamepadButtonMax GamepadButton = GamepadButton31
  55. )
  56. // StandardGamepadButton represents a gamepad button in the standard layout.
  57. //
  58. // The layout and the button values are based on the web standard.
  59. // See https://www.w3.org/TR/gamepad/#remapping.
  60. type StandardGamepadButton = driver.StandardGamepadButton
  61. // StandardGamepadButtons
  62. const (
  63. StandardGamepadButtonRightBottom StandardGamepadButton = driver.StandardGamepadButtonRightBottom
  64. StandardGamepadButtonRightRight StandardGamepadButton = driver.StandardGamepadButtonRightRight
  65. StandardGamepadButtonRightLeft StandardGamepadButton = driver.StandardGamepadButtonRightLeft
  66. StandardGamepadButtonRightTop StandardGamepadButton = driver.StandardGamepadButtonRightTop
  67. StandardGamepadButtonFrontTopLeft StandardGamepadButton = driver.StandardGamepadButtonFrontTopLeft
  68. StandardGamepadButtonFrontTopRight StandardGamepadButton = driver.StandardGamepadButtonFrontTopRight
  69. StandardGamepadButtonFrontBottomLeft StandardGamepadButton = driver.StandardGamepadButtonFrontBottomLeft
  70. StandardGamepadButtonFrontBottomRight StandardGamepadButton = driver.StandardGamepadButtonFrontBottomRight
  71. StandardGamepadButtonCenterLeft StandardGamepadButton = driver.StandardGamepadButtonCenterLeft
  72. StandardGamepadButtonCenterRight StandardGamepadButton = driver.StandardGamepadButtonCenterRight
  73. StandardGamepadButtonLeftStick StandardGamepadButton = driver.StandardGamepadButtonLeftStick
  74. StandardGamepadButtonRightStick StandardGamepadButton = driver.StandardGamepadButtonRightStick
  75. StandardGamepadButtonLeftTop StandardGamepadButton = driver.StandardGamepadButtonLeftTop
  76. StandardGamepadButtonLeftBottom StandardGamepadButton = driver.StandardGamepadButtonLeftBottom
  77. StandardGamepadButtonLeftLeft StandardGamepadButton = driver.StandardGamepadButtonLeftLeft
  78. StandardGamepadButtonLeftRight StandardGamepadButton = driver.StandardGamepadButtonLeftRight
  79. StandardGamepadButtonCenterCenter StandardGamepadButton = driver.StandardGamepadButtonCenterCenter
  80. StandardGamepadButtonMax StandardGamepadButton = StandardGamepadButtonCenterCenter
  81. )
  82. // StandardGamepadAxis represents a gamepad axis in the standard layout.
  83. //
  84. // The layout and the button values are based on the web standard.
  85. // See https://www.w3.org/TR/gamepad/#remapping.
  86. type StandardGamepadAxis = driver.StandardGamepadAxis
  87. // StandardGamepadAxes
  88. const (
  89. StandardGamepadAxisLeftStickHorizontal StandardGamepadAxis = driver.StandardGamepadAxisLeftStickHorizontal
  90. StandardGamepadAxisLeftStickVertical StandardGamepadAxis = driver.StandardGamepadAxisLeftStickVertical
  91. StandardGamepadAxisRightStickHorizontal StandardGamepadAxis = driver.StandardGamepadAxisRightStickHorizontal
  92. StandardGamepadAxisRightStickVertical StandardGamepadAxis = driver.StandardGamepadAxisRightStickVertical
  93. StandardGamepadAxisMax StandardGamepadAxis = StandardGamepadAxisRightStickVertical
  94. )