Repository: AvaloniaUI/Avalonia
File: src/iOS/Avalonia.iOS/InputHandler.cs (C#)

Code before:
    }

    private void UpdateInertiaScrolling()
    {
#if !TVOS
        _momentumVelocityX *= DecelerationRate;
        _momentumVelocityY *= DecelerationRate;

        var currentMagnitude = Math.Sqrt(_momentumVelocityX * _momentumVelocityX + _momentumVelocityY * _momentumVelocityY);

        if (currentMagnitude < 0.0001)
        {
            StopMomentumScrolling();
            return;
        }
        
        // UIPanGestureRecognizer will continue to upload the location of the pointer,
        // to where it would be if it was moving with the current velocity,
        // even though the pointer on screen is not moving.
        // We can cache the location when we start scrolling and keep it static
        // until the inertia stops.
        _tl.Input?.Invoke(new RawMouseWheelEventArgs(
            _mouseDevice, 
            (ulong)(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()), 
            Root,
            _cachedScrollLocation ?? new Point(0, 0),
            new Vector(_momentumVelocityX, _momentumVelocityY),
            RawInputModifiers.None
        ));
#endif
    }

#pragma warning disable CA1416
    private static Dictionary<UIKeyboardHidUsage, PhysicalKey> s_keys = new()
    {
        //[UIKeyboardHidUsage.KeyboardErrorRollOver] = PhysicalKey.None,
        //[UIKeyboardHidUsage.KeyboardPostFail] = PhysicalKey.None,
        //[UIKeyboardHidUsage.KeyboardErrorUndefined] = PhysicalKey.None,
        [UIKeyboardHidUsage.KeyboardA] = PhysicalKey.A,
        [UIKeyboardHidUsage.KeyboardB] = PhysicalKey.B,
        [UIKeyboardHidUsage.KeyboardC] = PhysicalKey.C,
        [UIKeyboardHidUsage.KeyboardD] = PhysicalKey.D,
        [UIKeyboardHidUsage.KeyboardE] = PhysicalKey.E,
        [UIKeyboardHidUsage.KeyboardF] = PhysicalKey.F,
        [UIKeyboardHidUsage.KeyboardG] = PhysicalKey.G,
        [UIKeyboardHidUsage.KeyboardH] = PhysicalKey.H,
        [UIKeyboardHidUsage.KeyboardI] = PhysicalKey.I,
        [UIKeyboardHidUsage.KeyboardJ] = PhysicalKey.J,
        [UIKeyboardHidUsage.KeyboardK] = PhysicalKey.K,
        [UIKeyboardHidUsage.KeyboardL] = PhysicalKey.L,
        [UIKeyboardHidUsage.KeyboardM] = PhysicalKey.M,

Review comment (performance):
Maybe instead check for `_cachedScrollLocation` being `null` and not fire the event? The field being `null` means that StopMomentumScrolling was called, so we don't want to keep sending updates (and shouldn't be in this method anyway).

Code after:
    }

    private void UpdateInertiaScrolling()
    {
#if !TVOS
        _momentumVelocityX *= DecelerationRate;
        _momentumVelocityY *= DecelerationRate;

        var currentMagnitude = Math.Sqrt(_momentumVelocityX * _momentumVelocityX + _momentumVelocityY * _momentumVelocityY);

        if (currentMagnitude < 0.0001 || _cachedScrollLocation is null)
        {
            StopMomentumScrolling();
            return;
        }
        
        // UIPanGestureRecognizer will continue to upload the location of the pointer,
        // to where it would be if it was moving with the current velocity,
        // even though the pointer on screen is not moving.
        // We can cache the location when we start scrolling and keep it static
        // until the inertia stops.
        _tl.Input?.Invoke(new RawMouseWheelEventArgs(
            _mouseDevice, 
            (ulong)(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()), 
            Root,
            _cachedScrollLocation.Value,
            new Vector(_momentumVelocityX, _momentumVelocityY),
            RawInputModifiers.None
        ));
#endif
    }

#pragma warning disable CA1416
    private static Dictionary<UIKeyboardHidUsage, PhysicalKey> s_keys = new()
    {
        //[UIKeyboardHidUsage.KeyboardErrorRollOver] = PhysicalKey.None,
        //[UIKeyboardHidUsage.KeyboardPostFail] = PhysicalKey.None,
        //[UIKeyboardHidUsage.KeyboardErrorUndefined] = PhysicalKey.None,
        [UIKeyboardHidUsage.KeyboardA] = PhysicalKey.A,
        [UIKeyboardHidUsage.KeyboardB] = PhysicalKey.B,
        [UIKeyboardHidUsage.KeyboardC] = PhysicalKey.C,
        [UIKeyboardHidUsage.KeyboardD] = PhysicalKey.D,
        [UIKeyboardHidUsage.KeyboardE] = PhysicalKey.E,
        [UIKeyboardHidUsage.KeyboardF] = PhysicalKey.F,
        [UIKeyboardHidUsage.KeyboardG] = PhysicalKey.G,
        [UIKeyboardHidUsage.KeyboardH] = PhysicalKey.H,
        [UIKeyboardHidUsage.KeyboardI] = PhysicalKey.I,
        [UIKeyboardHidUsage.KeyboardJ] = PhysicalKey.J,
        [UIKeyboardHidUsage.KeyboardK] = PhysicalKey.K,
        [UIKeyboardHidUsage.KeyboardL] = PhysicalKey.L,
        [UIKeyboardHidUsage.KeyboardM] = PhysicalKey.M,