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