| 29 | } |
| 30 | |
| 31 | Cursor::Cursor(System::Window& window, Triggers::TriggerManager& triggers) |
| 32 | : m_window(window) |
| 33 | , m_cursorTriggers(triggers.createTriggerGroup("Event", "Cursor")) |
| 34 | { |
| 35 | m_constraint = Constraints::Default; |
| 36 | m_constraintCondition = []() { return true; }; |
| 37 | |
| 38 | m_buttonState[sf::Mouse::Button::Left] |
| 39 | = sf::Mouse::isButtonPressed(sf::Mouse::Button::Left); |
| 40 | m_buttonState[sf::Mouse::Button::Middle] |
| 41 | = sf::Mouse::isButtonPressed(sf::Mouse::Button::Middle); |
| 42 | m_buttonState[sf::Mouse::Button::Right] |
| 43 | = sf::Mouse::isButtonPressed(sf::Mouse::Button::Right); |
| 44 | |
| 45 | m_cursorTriggers->add("Move"); |
| 46 | m_cursorTriggers->add("Press"); |
| 47 | m_cursorTriggers->add("Release"); |
| 48 | m_cursorTriggers->add("Hold"); |
| 49 | |
| 50 | m_saveOldPos = sf::Mouse::getPosition(); |
| 51 | } |
| 52 | |
| 53 | int Cursor::getConstrainedX() const |
| 54 | { |
nothing calls this directly
no test coverage detected