So far i can get a List of the joysticks connected to my pc.
But now i want to send effects for example to send a command that will make a button click for example the triangle button or the square button. 

But i'm not sure how to continue with the Effects and how to send the commands to the buttons.

I'm stuck in the HandleJoystick method.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    using SharpDX;
    using SharpDX.DirectInput;
    
    
    namespace Ps4_Controller
    {
        public partial class Form1 : Form
        {
            DirectInput input = new DirectInput();
            Joystick stick;
    
            public Form1()
            {
                InitializeComponent();
    
                stick = ListJoysticks()[0];
            }
    
            private Joystick[] ListJoysticks()
            {
                List<Joystick> sticks = new List<Joystick>();
    
                foreach (DeviceInstance device in input.GetDevices(DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly))
                {
                    Joystick stick = new Joystick(input, device.InstanceGuid);
                    stick.Acquire();
                    
                    foreach (DeviceObjectInstance deviceObject in stick.GetObjects(DeviceObjectTypeFlags.Axis))
                    {
                        stick.GetObjectPropertiesById(deviceObject.ObjectId).Range = new InputRange(-100, 100);
                    }
                    sticks.Add(stick);
                }
                return sticks.ToArray();
            }
    
            private void HandleJoystick()
            {
                Joystick stick = ListJoysticks()[0];
                int[] axis = new int[0];
    
                foreach (DeviceObjectInstance doi in stick.GetObjects())
                {
                    axis = new int[axis.Length + 1];
                    axis[axis.Length - 1] = doi.Offset;
                }
    
                EffectParameters ep = new EffectParameters();
                DeviceInstance stick1 = new DeviceInstance();
                
    
                Effect effect = new Effect(stick.);
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
    
            }
    }