Updated to work with new NativeTextEvent event types

(cherry picked from commit c254e8fd129abeb64ed5949e2e5781d6b5cca9d3)