MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleTextEvent

Method HandleTextEvent

src/SFGUI/Entry.cpp:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void Entry::HandleTextEvent( char32_t character ) {
163 if( m_max_length > 0 && static_cast<int>( m_string.getSize() ) >= m_max_length ) {
164 return;
165 }
166
167 if( character > 0x1f && character != 0x7f ) {
168 // not a control character
169 m_string.insert( static_cast<std::size_t>( m_cursor_position ), character );
170 MoveCursor( 1 );
171
172 GetSignals().Emit( OnTextChanged );
173 }
174}
175
176void Entry::HandleKeyEvent( sf::Keyboard::Key /*key*/, sf::Keyboard::Scancode scancode, bool press ) {
177 if( !press || !HasFocus() ) {

Callers

nothing calls this directly

Calls 1

EmitMethod · 0.80

Tested by

no test coverage detected