From 15c612fe868c72aa8ef31bdd97b01d918ecae733 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 11 Nov 2024 16:54:05 +0000 Subject: [PATCH] Remove unnecessary virtual & protected modifiers --- osu.Framework/Platform/SDL3/SDL3Window.cs | 4 ++-- osu.Framework/Platform/SDL3/SDL3Window_Input.cs | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/osu.Framework/Platform/SDL3/SDL3Window.cs b/osu.Framework/Platform/SDL3/SDL3Window.cs index 5944581b10..77c0f4fc3f 100644 --- a/osu.Framework/Platform/SDL3/SDL3Window.cs +++ b/osu.Framework/Platform/SDL3/SDL3Window.cs @@ -501,11 +501,11 @@ protected virtual void HandleEvent(SDL_Event e) break; case SDL_EventType.SDL_EVENT_TEXT_EDITING: - HandleTextEditingEvent(e.edit); + handleTextEditingEvent(e.edit); break; case SDL_EventType.SDL_EVENT_TEXT_INPUT: - HandleTextInputEvent(e.text); + handleTextInputEvent(e.text); break; case SDL_EventType.SDL_EVENT_KEYMAP_CHANGED: diff --git a/osu.Framework/Platform/SDL3/SDL3Window_Input.cs b/osu.Framework/Platform/SDL3/SDL3Window_Input.cs index 5c340f8e37..7709f531eb 100644 --- a/osu.Framework/Platform/SDL3/SDL3Window_Input.cs +++ b/osu.Framework/Platform/SDL3/SDL3Window_Input.cs @@ -472,18 +472,18 @@ private void handleMouseMotionEvent(SDL_MouseMotionEvent evtMotion) MouseMoveRelative?.Invoke(new Vector2(evtMotion.xrel * Scale, evtMotion.yrel * Scale)); } - protected virtual void HandleTextInputEvent(SDL_TextInputEvent evtText) + private void handleTextInputEvent(SDL_TextInputEvent evtText) { string? text = evtText.GetText(); Debug.Assert(text != null); - TriggerTextInput(text); + TextInput?.Invoke(text); } - protected virtual void HandleTextEditingEvent(SDL_TextEditingEvent evtEdit) + private void handleTextEditingEvent(SDL_TextEditingEvent evtEdit) { string? text = evtEdit.GetText(); Debug.Assert(text != null); - TriggerTextEditing(text, evtEdit.start, evtEdit.length); + TextEditing?.Invoke(text, evtEdit.start, evtEdit.length); } private void handleKeyboardEvent(SDL_KeyboardEvent evtKey) @@ -713,15 +713,11 @@ private void updateConfineMode() /// public event Action? TextInput; - protected void TriggerTextInput(string text) => TextInput?.Invoke(text); - /// /// Invoked when an IME text editing event occurs. /// public event TextEditingDelegate? TextEditing; - protected void TriggerTextEditing(string text, int start, int length) => TextEditing?.Invoke(text, start, length); - /// public event Action? KeymapChanged;