internal static CommandBinding CreateLegacyBinding(string name, Func <FSharpOption <int>, Register, CommandResult> func) { var fsharpFunc = func.ToFSharpFunc(); var list = name.Select(KeyInputUtil.CharToKeyInput).ToFSharpList(); var commandName = KeyInputSet.NewManyKeyInputs(list); return(CommandBinding.NewLegacyBinding(commandName, CommandFlags.None, fsharpFunc)); }
public void GetKeyMappingResultFromMultiple2() { _map.MapWithNoRemap("aa", "b", KeyRemapMode.Normal); var input = "a".Select(KeyInputUtil.CharToKeyInput).ToFSharpList(); var res = _map.GetKeyMapping(KeyInputSet.NewManyKeyInputs(input), KeyRemapMode.Normal); Assert.True(res.IsNeedsMoreInput); }
public void GetKeyMappingResultFromMultiple1() { _map.MapWithNoRemap("aa", "b", KeyRemapMode.Normal); var input = "aa".Select(KeyInputUtil.CharToKeyInput).ToFSharpList(); var res = _map.GetKeyMapping(KeyInputSet.NewManyKeyInputs(input), KeyRemapMode.Normal); Assert.Equal('b', res.AsMapped().Item.KeyInputs.Single().Char); }
internal static CommandBinding CreateNormalBinding(string name, Func <CommandData, CommandResult> func) { var fsharpFunc = func.ToFSharpFunc(); var list = name.Select(KeyInputUtil.CharToKeyInput).ToFSharpList(); var commandName = KeyInputSet.NewManyKeyInputs(list); var command = NormalCommand.NewPing(new PingData(fsharpFunc)); return(CommandBinding.NewNormalBinding(commandName, CommandFlags.None, command)); }
private KeyInputSet CreateMany(params char[] all) { return(KeyInputSet.NewManyKeyInputs(all.Select(KeyInputUtil.CharToKeyInput).ToFSharpList())); }