// ====================================================================== void EventInputQueue::fire_timer_callback(OSObject* /*notuse_owner*/, IOTimerEventSource* /*notuse_sender*/) { if (! queue_) return; // IOLOG_DEVEL("EventInputQueue::fire queue_->size = %d\n", static_cast<int>(queue_->size())); // ------------------------------------------------------------ // handle SimultaneousKeyPresses do { Item* front = static_cast<Item*>(queue_->front()); if (! front) return; // ------------------------------------------------------------ // clear temporary_count_ // // Don't call FlagStatus::set(key, flags) here. // If SimultaneousKeyPresses is enabled, keys may be dropped. // For example, Shift_L+Shift_R to Space is enabled, Shift_L and Shift_R may be dropped. // If we call FlagStatus::set(key, flags) here, dropped keys are kept as pushed status. // So, call FlagStatus::set(key, flags) after EventInputQueue. // ------------------------------------------------------------ if (! front->retainFlagStatusTemporaryCount) { FlagStatus::globalFlagStatus().set(); } CommonData::setcurrent_deviceIdentifier(front->deviceIdentifier); { Params_KeyboardEventCallBack* params = (front->params).get_Params_KeyboardEventCallBack(); if (params) { CommonData::setcurrent_keyboardType(params->keyboardType); } } } while (RemapClassManager::remap_simultaneouskeypresses()); // ------------------------------------------------------------ // handle BlockUntilKeyUp // // Note: // We need to handle BlockUntilKeyUp after SimultaneousKeyPresses // in order to avoid unintended modification by SimultaneousKeyPresses. bool needToFire = BlockUntilKeyUpHander::doBlockUntilKeyUp(); if (needToFire) { doFire(); } setTimer(); }
// ====================================================================== void EventInputQueue::fire_timer_callback(OSObject* /*notuse_owner*/, IOTimerEventSource* /*notuse_sender*/) { // IOLOG_DEVEL("EventInputQueue::fire queue_.size = %d\n", static_cast<int>(queue_.size())); // ------------------------------------------------------------ // Ignore key bouncing (chattering). if (Config::get_essential_config(BRIDGE_ESSENTIAL_CONFIG_INDEX_general_ignore_bouncing_events)) { retry: for (Item* p = static_cast<Item*>(queue_.safe_front()); p; p = static_cast<Item*>(p->getnext())) { // Search key up, key down event. bool iskeydown; if (p->getParamsBase().iskeydown(iskeydown) && !iskeydown) { Item* keyUpEvent = p; FromEvent fromEvent(p->getParamsBase()); for (Item* q = static_cast<Item*>(p->getnext()); q; q = static_cast<Item*>(q->getnext())) { if (fromEvent.isTargetUpEvent(q->getParamsBase())) { break; } else if (fromEvent.isTargetDownEvent(q->getParamsBase())) { Item* keyDownEvent = q; uint32_t ms1 = (keyUpEvent->ic).getmillisec(); uint32_t ms2 = (keyDownEvent->ic).getmillisec(); uint32_t interval = ms1 - ms2; uint32_t threshold = 0; switch (fromEvent.getType()) { case FromEvent::Type::KEY: case FromEvent::Type::CONSUMER_KEY: threshold = Config::get_ignore_bouncing_threshold_for_keyboard(); break; case FromEvent::Type::POINTING_BUTTON: threshold = Config::get_ignore_bouncing_threshold_for_mice(); break; case FromEvent::Type::NONE: break; } if (interval < threshold) { IOLOG_INFO("Bouncing events are removed. (interval: %d, threshold: %d)\n", interval, threshold); queue_.erase_and_delete(keyUpEvent); queue_.erase_and_delete(keyDownEvent); goto retry; } else { IOLOG_INFO("Bouncing events? (interval: %d, threshold: %d)\n", interval, threshold); } } } } } } // ------------------------------------------------------------ // handle SimultaneousKeyPresses while (true) { Item* front = static_cast<Item*>(queue_.safe_front()); if (!front) return; // ------------------------------------------------------------ // clear temporary_count_ // // Don't call FlagStatus::set(key, flags) here. // If SimultaneousKeyPresses is enabled, keys may be dropped. // For example, Shift_L+Shift_R to Space is enabled, Shift_L and Shift_R may be dropped. // If we call FlagStatus::set(key, flags) here, dropped keys are kept as pushed status. // So, call FlagStatus::set(key, flags) after EventInputQueue. // ------------------------------------------------------------ if (!front->retainFlagStatusTemporaryCount) { FlagStatus::globalFlagStatus().set(); } CommonData::setcurrent_deviceIdentifier(front->deviceIdentifier); { auto params = (front->getParamsBase()).get_Params_KeyboardEventCallBack(); if (params) { CommonData::setcurrent_keyboardType(params->keyboardType); } } bool iskeydown = false; if (!(front->getParamsBase()).iskeydown(iskeydown)) { iskeydown = true; } if (!RemapClassManager::remap_simultaneouskeypresses(iskeydown)) { break; } } // ------------------------------------------------------------ // handle BlockUntilKeyUp // // Note: // We need to handle BlockUntilKeyUp after SimultaneousKeyPresses // in order to avoid unintended modification by SimultaneousKeyPresses. bool needToFire = BlockUntilKeyUpHander::doBlockUntilKeyUp(); if (needToFire) { doFire(); } setTimer(); }
void wallerFire(int dir, int dmg) { doFire(dir, wallerFireDmg()); LAST_TURN_FIRE = getTurn(); }
void Fire::excute(){ doFire(); }