veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

TextInputEvent missing GetText() #535

Closed kazzmir closed 1 year ago

kazzmir commented 1 year ago

Commit 1aaca478b312bea92192d243d7f2c19a1369fc14 removed the GetText() function from TextInputEvent and TextEditingEvent. It looks like this is an oversight, as the other functions for those events remain (GetTimestamp(), GetType(), ...).

GetText() can trivially be implemented as

func (e TextEditingEvent) GetText() string {
  return e.Text
}

and the same for TextInputEvent.

I think GetText() should remain to keep API compatability.

veeableful commented 1 year ago

Hi @kazzmir, thanks for reporting this! I have added them back in the master branch.

kazzmir commented 1 year ago

:+1: