Context

Decision

The word “decision” is from Decision tree - Wikipedia.

In keyseq preferences, every area in a rectangle with blue border represents a decision node.

A decision node contains,

  • zero or more action nodes, and
  • zero or more chance nodes.

An action can be,

  • post a notification
  • open an app
  • open a URL
  • run an AppleScript file
  • etc.

A chance node contains, - a pattern node, and - a decision node, recursively.

A pattern can be,

  • a keystroke, which matches users’ typing, or
  • a message pattern, which matches some actions’ outcome.

A session includes the following steps,

  • The leader key is pressed, then
  • the root decision’s actions are executed in order.
  • If one of these actions has outcome, keyseq try to match the outcome with the root decision’s every chance’s pattern.
  • If none of these action has outcome, keyseq waits users’ typing, then try to match the keystroke with these patterns.
  • Once matched, the corresponding chance’s decision is chosen.
    • Then the same process applys on the the decision.
  • If neither actions’ outcome nor users’ typing matches, keyseq stop the session.