示例#1
0
bool VirtualKey::VK_LAZY::handle(const Params_KeyboardEventCallBack& params, AutogenId autogenId, PhysicalEventType physicalEventType) {
  ModifierFlag f = getModifierFlag(params.key);
  if (f == ModifierFlag::ZERO) return false;

  // ----------------------------------------
  if (params.repeat) return true;

  if (params.eventType == EventType::DOWN) {
    FlagStatus::globalFlagStatus().lazy_increase(f);
  } else if (params.eventType == EventType::UP) {
    FlagStatus::globalFlagStatus().lazy_decrease(f);
  } else {
    IOLOG_ERROR("Handle_VK_LAZY invalid EventType.\n");
  }

  return true;
}
示例#2
0
  bool
  VirtualKey::VK_LAZY::handle(const Params_KeyboardEventCallBack& params)
  {
    ModifierFlag f = getModifierFlag(params.key);
    if (f == ModifierFlag::NONE) return false;

    // ----------------------------------------
    if (params.repeat) return true;

    if (params.eventType == EventType::DOWN) {
      FlagStatus::increase(f);
    } else if (params.eventType == EventType::UP) {
      FlagStatus::decrease(f);
    } else {
      IOLOG_ERROR("Handle_VK_LAZY invalid EventType.\n");
    }

    return true;
  }
示例#3
0
 bool isModifier(void) const { return getModifierFlag() != ModifierFlag::NONE; }