Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextInput.OnInput not firing on Wayland #598

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Celeste.Mod.mm/Mod/Everest/TextInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ internal static void Initialize(Game game) {
// public static event Action<char> TextInput;
e_TextInput.AddEventHandler(null, new Action<char>(ReceiveTextInput).CastDelegate(e_TextInput.EventHandlerType));

// Some platforms like Linux/Wayland may require calling TextInputEXT.StartTextInput to receive events for TextInputEXT.TextInput
MethodInfo m_StartTextInput = t_TextInputExt?.GetMethod("StartTextInput", new Type[] { } );
GaimeWolves marked this conversation as resolved.
Show resolved Hide resolved
m_StartTextInput?.Invoke(t_TextInputExt, null);

// SDL2 offers SDL_GetClipboardText and SDL_SetClipboardText
Type t_SDL2 = typeof(Keyboard).Assembly.GetType("SDL2.SDL");
_GetClipboardText = t_SDL2.GetMethod("SDL_GetClipboardText").CreateDelegate(typeof(Func<string>)) as Func<string>;
Expand Down