internal BindResult <Motion> Process(string input, bool enter = false) { var res = _capture.GetOperatorMotion(KeyInputUtil.CharToKeyInput(input[0])); foreach (var cur in input.Skip(1)) { Assert.IsTrue(res.IsNeedMoreInput); var needMore = res.AsNeedMoreInput(); res = needMore.Item.BindFunction.Invoke(KeyInputUtil.CharToKeyInput(cur)); } if (enter) { var needMore = res.AsNeedMoreInput(); res = needMore.Item.BindFunction.Invoke(KeyInputUtil.EnterKey); } return(res.Convert(x => x.Item1)); }
public static BindResult <Tuple <Motion, FSharpOption <int> > > GetOperatorMotion(this IMotionCapture capture, char c) { return(capture.GetOperatorMotion(KeyInputUtil.CharToKeyInput(c))); }