activate method

Cmd? activate(
  1. KeyMsg msg
)

Attempts to activate this binding for msg.

Returns the result of handler when the binding is enabled and the key matches msg, or null otherwise.

Implementation

Cmd? activate(KeyMsg msg) {
  if (!enabled || handler == null) return null;
  if (!matches(msg)) return null;
  return handler!();
}