示例#1
0
bool KeyCode::FNKeyHack::remap(KeyCode& key, Flags flags, EventType eventType, bool& active, KeyCode fromKeyCode, KeyCode toKeyCode) {
  if (key != fromKeyCode) return false;

  bool isKeyDown = eventType.isKeyDownOrModifierDown(key, flags);
  if (isKeyDown) {
    if (!flags.isOn(ModifierFlag::FN)) return false;
    active = true;
  } else {
    if (!active) return false;
    active = false;
  }

  key = toKeyCode;

  return true;
}
示例#2
0
 Params_KeyboardEventCallBack(EventType et, Flags fl, KeyCode kc,
                              KeyboardType kt, bool r) : eventType(et), flags(fl), key(kc),
                                                         charCode(0), charSet(0), origCharCode(0), origCharSet(0),
                                                         keyboardType(kt), repeat(r),
                                                         ex_iskeydown(et.isKeyDownOrModifierDown(kc, fl)) {}