simulate button event clicked

Started by billarhos, 31 October 2015, 18:31:00


Hi, i am struggling to make a button get pressed from code. The reason i want this is because i have shorcuts to simulate button events.


if (event.key.code == sf::Keyboard::S)

Well, if i use "leftMouseReleased" function it works however the text color stays on a hover(whatever) state.
Is any cure for this?


It seems like button assumed that on mouse release you would be back in hover state (which makes some sense since internally tgui can only call that function when the mouse is effectively on top of the button). Other widgets don't seem to have this problem. Code on github has been updated to make it go back to normal state when the mouse is not on top of the button.