keyboard_t::iterator keyboard_t::insert(iterator parent, const adobe::poly_key_handler_t& element) { parent = parent == iterator() ? forest_m.end() : // last child of root, or trailing_of(parent); // the last child of the parent return forest_m.insert(parent, element); }
bool keyboard_t::dispatch(key_type virtual_key, bool pressed, adobe::modifiers_t modifiers) { iterator parent(forest_m.begin()); typedef keyboard_forest_t::postorder_iterator postorder_iterator; for (postorder_iterator iter(leading_of(parent)), last(++trailing_of(parent)); iter != last; ++iter) { if (iter->handle_key(virtual_key, pressed, modifiers)) return true; } return false; }
bool keyboard_t::dispatch(key_type virtual_key, bool pressed, adobe::modifiers_t modifiers, const adobe::any_regular_t& base_handler) { iterator parent(handler_to_iterator(base_handler)); if (parent == forest_m.end()) return false; typedef keyboard_forest_t::postorder_iterator postorder_iterator; for (postorder_iterator iter(leading_of(parent)), last(++trailing_of(parent)); iter != last; ++iter) if (iter->handle_key(virtual_key, pressed, modifiers)) return true; return false; }