event.go (9849B)
1 // Copyright 2013 The Ebiten Authors 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 // Code generated by genevents.go using 'go generate'. DO NOT EDIT. 16 17 package driver 18 19 type Event interface{} 20 21 // KeyboardKeyCharacter is an event that occurs when a character is actually typed on the keyboard. This may be provided by an input method. 22 type KeyboardKeyCharacter struct { 23 // Key is the key code of the key typed. 24 Key Key 25 26 // Modifier is the logical-or value of the modifiers pressed together with the key. 27 Modifier Modifier 28 29 // Character is the character that was typed. 30 Character rune 31 } 32 33 // KeyboardKeyDown is an event that occurs when a key is pressed on the keyboard. 34 type KeyboardKeyDown struct { 35 // Key is the key code of the key pressed or released. 36 Key Key 37 38 // Modifier is the logical-or value of the modifiers pressed together with the key. 39 Modifier Modifier 40 } 41 42 // KeyboardKeyUp is an event that occurs when a key is released on the keyboard. 43 type KeyboardKeyUp struct { 44 // Key is the key code of the key pressed or released. 45 Key Key 46 47 // Modifier is the logical-or value of the modifiers pressed together with the key. 48 Modifier Modifier 49 } 50 51 // GamepadAxis is for event where an axis on a gamepad changes. 52 type GamepadAxis struct { 53 // ID represents which gamepad caused the event. 54 ID int 55 56 // Axis is the axis of the game pad that changed position. 57 Axis int 58 59 // Position is the position of the axis after the change. It varies between -1.0 and 1.0. 60 Position float32 61 } 62 63 // GamepadButtonDown is a gamepad button press event. 64 type GamepadButtonDown struct { 65 // ID represents which gamepad caused the event. 66 ID int 67 68 // Button is the button that was pressed on the game pad. 69 Button int 70 71 // Pressure is the pressure that is applied to the gamepad button. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 72 Pressure float32 73 } 74 75 // GamepadButtonUp is a gamepad button release event. 76 type GamepadButtonUp struct { 77 // ID represents which gamepad caused the event. 78 ID int 79 80 // Button is the button that was pressed on the game pad. 81 Button int 82 83 // Pressure is the pressure that is applied to the gamepad button. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 84 Pressure float32 85 } 86 87 // GamepadAttach happens when a new gamepad is attached. 88 type GamepadAttach struct { 89 // ID represents which gamepad caused the event. 90 ID int 91 92 // Axes represents the amount of axes the gamepad has. 93 Axes int 94 95 // Buttons represents the amount of buttons the gamepad has. 96 Buttons int 97 } 98 99 // GamepadDetach happens when a gamepad is detached. 100 type GamepadDetach struct { 101 // ID represents which gamepad caused the event. 102 ID int 103 } 104 105 // MouseMove is a mouse movement event. 106 type MouseMove struct { 107 // X is the X position of the mouse pointer. This value is expressed in device independent pixels. 108 X float32 109 110 // Y is the Y position of the mouse pointer. This value is expressed in device independent pixels. 111 Y float32 112 113 // DeltaX is the change in X since the last MouseMove event. This value is expressed in device independent pixels. 114 DeltaX float32 115 116 // DeltaY is the change in Y since the last MouseMove event. This value is expressed in device independent pixels. 117 DeltaY float32 118 } 119 120 // MouseWheel is a mouse wheel event. 121 type MouseWheel struct { 122 // X is the X position of the mouse wheel. This value is expressed in arbitrary units. It increases when the mouse wheel is scrolled downwards, and decreases when the mouse is scrolled upwards. 123 X float32 124 125 // Y is the Y position of the mouse wheel. This value is expressed in arbitrary units. It increases when the mouse wheel is scrolled to the right, and decreases when the mouse is scrolled to the left. 126 Y float32 127 128 // DeltaX is the change in X since the last MouseWheel event. This value is expressed in arbitrary units. It is positive when the mouse wheel is scrolled downwards, and negative when the mouse is scrolled upwards. 129 DeltaX float32 130 131 // DeltaY is the change in Y since the last MouseWheel event. This value is expressed in arbitrary units. It is positive when the mouse wheel is scrolled to the right, and negative when the mouse is scrolled to the left. 132 DeltaY float32 133 } 134 135 // MouseButtonDown is a mouse button press event. 136 type MouseButtonDown struct { 137 // X is the X position of the mouse pointer. This value is expressed in device independent pixels. 138 X float32 139 140 // Y is the Y position of the mouse pointer. This value is expressed in device independent pixels. 141 Y float32 142 143 // Button is the button on the mouse that was pressed. TODO: this should change later from an int to an enumeration type. 144 Button int 145 146 // Pressure is the pressure applied on the mouse button. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 147 Pressure float32 148 } 149 150 // MouseButtonUp is a mouse button release event. 151 type MouseButtonUp struct { 152 // X is the X position of the mouse pointer. This value is expressed in device independent pixels. 153 X float32 154 155 // Y is the Y position of the mouse pointer. This value is expressed in device independent pixels. 156 Y float32 157 158 // Button is the button on the mouse that was pressed. TODO: this should change later from an int to an enumeration type. 159 Button int 160 161 // Pressure is the pressure applied on the mouse button. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 162 Pressure float32 163 } 164 165 // MouseEnter occurs when the mouse enters the view window. 166 type MouseEnter struct { 167 // X is the X position of the mouse pointer. This value is expressed in device independent pixels. 168 X float32 169 170 // Y is the Y position of the mouse pointer. This value is expressed in device independent pixels. 171 Y float32 172 } 173 174 // MouseLeave occurs when the mouse leaves the view window. 175 type MouseLeave struct { 176 // X is the X position of the mouse pointer. This value is expressed in device independent pixels. 177 X float32 178 179 // Y is the Y position of the mouse pointer. This value is expressed in device independent pixels. 180 Y float32 181 } 182 183 // TouchBegin occurs when a touch begins. 184 type TouchBegin struct { 185 // ID identifies the touch that caused the touch event. 186 ID int 187 188 // X is the X position of the touch. This value is expressed in device independent pixels. 189 X float32 190 191 // Y is the Y position of the touch. This value is expressed in device independent pixels. 192 Y float32 193 194 // DeltaX is the change in X since last touch event. This value is expressed in device independent pixels. 195 DeltaX float32 196 197 // Deltay is the change in Y since last touch event. This value is expressed in device independent pixels. 198 Deltay float32 199 200 // Pressure of applied touch. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 201 Pressure float32 202 203 // Primary represents whether the touch event is the primary touch or not. If it is true, then it is a primary touch. If it is false then it is not. 204 Primary bool 205 } 206 207 // TouchMove occurs when a touch moved, or in other words, is dragged. 208 type TouchMove struct { 209 // ID identifies the touch that caused the touch event. 210 ID int 211 212 // X is the X position of the touch. This value is expressed in device independent pixels. 213 X float32 214 215 // Y is the Y position of the touch. This value is expressed in device independent pixels. 216 Y float32 217 218 // DeltaX is the change in X since last touch event. This value is expressed in device independent pixels. 219 DeltaX float32 220 221 // Deltay is the change in Y since last touch event. This value is expressed in device independent pixels. 222 Deltay float32 223 224 // Pressure of applied touch. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 225 Pressure float32 226 227 // Primary represents whether the touch event is the primary touch or not. If it is true, then it is a primary touch. If it is false then it is not. 228 Primary bool 229 } 230 231 // TouchEnd occurs when a touch ends. 232 type TouchEnd struct { 233 // ID identifies the touch that caused the touch event. 234 ID int 235 236 // X is the X position of the touch. This value is expressed in device independent pixels. 237 X float32 238 239 // Y is the Y position of the touch. This value is expressed in device independent pixels. 240 Y float32 241 242 // DeltaX is the change in X since last touch event. This value is expressed in device independent pixels. 243 DeltaX float32 244 245 // Deltay is the change in Y since last touch event. This value is expressed in device independent pixels. 246 Deltay float32 247 248 // Pressure of applied touch. It varies between 0.0 for not pressed, and 1.0 for completely pressed. 249 Pressure float32 250 251 // Primary represents whether the touch event is the primary touch or not. If it is true, then it is a primary touch. If it is false then it is not. 252 Primary bool 253 } 254 255 // TouchCancel occurs when a touch is canceled. This can happen in various situations, depending on the underlying platform, for example when the application loses focus. 256 type TouchCancel struct { 257 // ID identifies the touch that caused the touch event. 258 ID int 259 } 260 261 // ViewUpdate occurs when the application is ready to update the next frame on the view port. 262 type ViewUpdate struct { 263 } 264 265 // ViewSize occurs when the size of the application's view port changes. 266 type ViewSize struct { 267 // Width is the width of the view. This value is expressed in device independent pixels. 268 Width int 269 270 // Height is the height of the view. This value is expressed in device independent pixels. 271 Height int 272 }