void PressDownKeys::add(KeyCode key, KeyboardType keyboardType) { if (key == KeyCode::VK_NONE) return; list_.push_back(new Item(key, keyboardType)); IOLOG_DEVEL("PressDownKeys::add key:%d, keyboardType:%d\n", key.get(), keyboardType.get()); }
void PressDownKeys::remove(KeyCode key, KeyboardType keyboardType) { Item* p = static_cast<Item*>(list_.safe_front()); for (;;) { if (!p) break; if (p->key == key && p->keyboardType == keyboardType) { p = static_cast<Item*>(list_.erase_and_delete(p)); } else { p = static_cast<Item*>(p->getnext()); } } IOLOG_DEVEL("PressDownKeys::remove key:%d, keyboardType:%d\n", key.get(), keyboardType.get()); }
// ---------------------------------------- static void log(bool isCaught, EventType eventType, Flags flags, KeyCode key, KeyboardType keyboardType, bool repeat) { IOLOG_DEBUG("KeyboardEventCallback [%7s]: eventType %2d, flags 0x%08x, key 0x%04x, kbdType %3d, repeat = %d\n", isCaught ? "caught" : "sending", eventType.get(), flags.get(), key.get(), keyboardType.get(), repeat); }
bool operator==(KeyboardType other) const { return value_ == other.get(); }