| 283 | } |
| 284 | |
| 285 | bool InputManager::injectMouseRelease(int _absx, int _absy, MouseButton _id) |
| 286 | { |
| 287 | if (_id != MouseButton::None && _id != MouseButton::MAX) |
| 288 | { |
| 289 | if (mMouseCapture[_id.getValue()]) |
| 290 | { |
| 291 | // drop capture |
| 292 | mMouseCapture[_id.getValue()] = false; |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | if (isFocusMouse()) |
| 297 | { |
| 298 | // если активный элемент заблокирован |
| 299 | if (!mWidgetMouseFocus->getInheritedEnabled()) |
| 300 | return true; |
| 301 | |
| 302 | IntPoint point(_absx, _absy); |
| 303 | if (mLayerMouseFocus != nullptr) |
| 304 | point = mLayerMouseFocus->getPosition(_absx, _absy); |
| 305 | mWidgetMouseFocus->_riseMouseButtonReleased(point.left, point.top, _id); |
| 306 | |
| 307 | // после вызова, виджет может быть сброшен |
| 308 | if (nullptr != mWidgetMouseFocus) |
| 309 | { |
| 310 | if (MouseButton::Left == _id) |
| 311 | { |
| 312 | if (mTimerDoubleClick < INPUT_TIME_DOUBLE_CLICK) |
| 313 | { |
| 314 | mWidgetMouseFocus->_riseMouseButtonClick(); |
| 315 | // might be reset in the call above, so check again |
| 316 | if (nullptr != mWidgetMouseFocus) |
| 317 | mWidgetMouseFocus->_riseMouseButtonDoubleClick(); |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | // проверяем над тем ли мы окном сейчас что и были при нажатии |
| 322 | Widget* item = LayerManager::getInstance().getWidgetFromPoint(_absx, _absy); |
| 323 | if (item == mWidgetMouseFocus) |
| 324 | { |
| 325 | mWidgetMouseFocus->_riseMouseButtonClick(); |
| 326 | } |
| 327 | mTimerDoubleClick = 0; |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | // для корректного отображения |
| 333 | injectMouseMove(_absx, _absy, mOldAbsZ); |
| 334 | |
| 335 | return true; |
| 336 | } |
| 337 | |
| 338 | return false; |
| 339 | } |
| 340 | |
| 341 | bool InputManager::injectKeyPress(KeyCode _key, Char _text) |
| 342 | { |
nothing calls this directly
no test coverage detected