chrisnorman7 / dart_sdl

Dart bindings for SDL
Mozilla Public License 2.0
9 stars 1 forks source link

TextEditingEvent shouldn't inherit from TextInputEvent #6

Closed Keithcat1 closed 2 years ago

Keithcat1 commented 2 years ago

The reason for this is that if you do:

if(event is TextInputEvent) {
  print("${event.text}");
}

this will also handle TextEditingEvents. This is probably not what people coming from other languages would expect and the meaning of text editing event is likely different than text input event. In addition, apparently when ALT + TAB-ing away from a window, SDL will generate one or more (I didn't check the exact number) of text editing events with an empty text property. I fixed the problem simply enough though by just not doing anything if it's a text editing event.

chrisnorman7 commented 2 years ago

Easy fix. Thanks for reporting.