function onKeyDown(predicate, callback, event)
    {
        if (predicate(event)) {
            event.consume(true);
            callback();
        }
    }
@param {function(!Event):boolean} predicate
@param {function()} callback
@param {!Event} event