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

Method HandleMouseButtonEvent

src/SFGUI/Entry.cpp:261–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void Entry::HandleMouseButtonEvent( sf::Mouse::Button button, bool press, int x, int /*y*/ ) {
262 if( !press || !IsMouseInWidget() ) {
263 return;
264 }
265
266 if( button != sf::Mouse::Button::Left ) {
267 // TODO: Maybe some more support for right clicking in the future.
268 return;
269 }
270
271 GrabFocus();
272 SetCursorPosition( GetPositionFromMouseX( x ) );
273}
274
275void Entry::HandleUpdate( float seconds ) {
276 if( !HasFocus() ) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected