Skip to content

Commit

Permalink
Remove unnecessary virtual & protected modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Susko3 committed Nov 11, 2024
1 parent d9603f7 commit 15c612f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions osu.Framework/Platform/SDL3/SDL3Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions osu.Framework/Platform/SDL3/SDL3Window_Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -713,15 +713,11 @@ private void updateConfineMode()
/// </summary>
public event Action<string>? TextInput;

protected void TriggerTextInput(string text) => TextInput?.Invoke(text);

/// <summary>
/// Invoked when an IME text editing event occurs.
/// </summary>
public event TextEditingDelegate? TextEditing;

protected void TriggerTextEditing(string text, int start, int length) => TextEditing?.Invoke(text, start, length);

/// <inheritdoc cref="IWindow.KeymapChanged"/>
public event Action? KeymapChanged;

Expand Down

0 comments on commit 15c612f

Please sign in to comment.