//private int MakeRowValue( // Func<IKeyboardState, bool>[] conditions, // IKeyboardState state) //{ // return conditions // .Select((arg, index) => arg(state) ? 1 << index : 0) // .Aggregate((seed, item) => seed | item); //} private Func <IKeyboardState, bool> GetCondition(SpeccyKey key) { var binding = _keyBindings .FirstOrDefault(arg => arg.Key == key); if (binding == null) { return(arg => false); } return(arg => binding.Match(arg)); }
public KeyBinding(SpeccyKey key, IEnumerable <IKeyCondition> conditions) { Key = key; _conditions = conditions; }