public override async void OnKeyPress(IntPtr wParam, IntPtr lParam)
        {
            base.OnKeyPress(wParam, lParam);

            var color = new RandomColor();

            var keys = _manhattanDistance.GetManhattanDistances(PressedKey, KeyMap.Keys);

            foreach (var key in keys)
            {
                await Task.Delay(1);

                React(key, color);
            }
        }
예제 #2
0
        public override async void OnKeyPress(IntPtr wParam, IntPtr lParam)
        {
            base.OnKeyPress(wParam, lParam);

            var manhattanKeys = _manhattanDistance.GetManhattanDistances(PressedKey, KeyMap.Keys).ToList();

            var maxDistance = manhattanKeys.Max(m => m.Distance);

            for (var i = 0; i <= maxDistance + 1; i++)
            {
                React(manhattanKeys, i - 1, _color);
                React(manhattanKeys, i, _rippleColor1);
                React(manhattanKeys, i + 1, _rippleColor2);
                await Task.Delay(50);
            }
        }