1 module cat.wheel.keysym; 2 3 import bindbc.sdl; 4 5 import cat.wheel.structs; 6 7 /** 8 * Key information for use in key events 9 */ 10 struct Keysym { 11 /// The virtual key involved in the event 12 SDL_Keycode code; 13 14 /// The modifiers being applied to the key 15 SDL_Keymod modifiers; 16 } 17 18 /** 19 * Mouse information for use in mouse button events 20 */ 21 struct MouseButton { 22 /// The mouse instance ID 23 uint instance; 24 25 /// The button modified 26 ubyte button; 27 28 static if (sdlSupport == SDLSupport.sdl200) { 29 /// 30 ubyte padding; 31 } else { 32 /// The number of times the mouse has been clicked in quick succession 33 ubyte clicks; 34 } 35 36 /// The position relative to the window 37 Vector2 position; 38 } 39 40 /** 41 * Mouse information for use in mouse motion events 42 */ 43 struct MouseMotion { 44 /// The mouse instance ID 45 uint instance; 46 47 /// Bitmask of the mouse state 48 uint state; 49 50 /// The new position relative to the window 51 Vector2 position; 52 53 /// The change in position relative to the window 54 Vector2 motion; 55 } 56 57 /** 58 * Mouse information for use in mouse wheel events 59 */ 60 struct MouseWheel { 61 /// The mouse instance ID 62 uint instance; 63 64 /** 65 * The amount scrolled 66 * X: Positive to the right, negative to the left 67 * Y: Positive up, negative down 68 */ 69 Vector2 delta; 70 71 static if (sdlSupport >= SDLSupport.sdl204) { 72 /// Whether it's reversed or not 73 int direction; 74 } 75 }