/** * \brief Returns whether this keyboard, joypad or mouse event * corresponds to pressing something. * * The thing pressed may be a key, a button or a direction. * If this is not a keyboard, joypad or mouse event, false is returned. * * \return true if something was pressed */ bool InputEvent::is_pressed() const { return is_keyboard_key_pressed() || is_direction_pressed() || is_joypad_button_pressed() || is_mouse_button_pressed(); }
/** * @brief Returns whether this keyboard or joypad event * corresponds to pressing something other than a direction. * * If this is not a keyboard or joypad event, false is returned. * * @return true if something other that a direction was pressed */ bool InputEvent::is_non_direction_pressed() { return is_pressed() && !!is_direction_pressed(); }