diff --git a/SDL3-CS/SDL3/SDL_events.cs b/SDL3-CS/SDL3/SDL_events.cs new file mode 100644 index 0000000..fc8a7cd --- /dev/null +++ b/SDL3-CS/SDL3/SDL_events.cs @@ -0,0 +1,37 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace SDL +{ + public unsafe partial struct SDL_TextInputEvent + { + public string? GetText() => SDL3.PtrToStringUTF8(text); + } + + public unsafe partial struct SDL_TextEditingEvent + { + public string? GetText() => SDL3.PtrToStringUTF8(text); + } + + public unsafe partial struct SDL_DropEvent + { + public string? GetSource() => SDL3.PtrToStringUTF8(source); + + public string? GetData() => SDL3.PtrToStringUTF8(data); + } + + public partial struct SDL_MouseButtonEvent + { + public SDLButton Button => (SDLButton)button; + } + + public partial struct SDL_GamepadAxisEvent + { + public SDL_GamepadAxis Axis => (SDL_GamepadAxis)axis; + } + + public partial struct SDL_GamepadButtonEvent + { + public SDL_GamepadButton Button => (SDL_GamepadButton)button; + } +} diff --git a/SDL3-CS/SDL3/SDL_keyboard.cs b/SDL3-CS/SDL3/SDL_keyboard.cs index 1082027..885fbc9 100644 --- a/SDL3-CS/SDL3/SDL_keyboard.cs +++ b/SDL3-CS/SDL3/SDL_keyboard.cs @@ -7,4 +7,9 @@ namespace SDL { [Typedef] public enum SDL_KeyboardID : UInt32; + + public partial struct SDL_Keysym + { + public SDL_Keymod Mod => (SDL_Keymod)mod; + } }