The code:
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();
List<Joystick> sticks = new List<Joystick>();
foreach (DeviceInstance device in input.GetDevices
(DeviceClass.GameControl,DeviceEnumerationFlags.AttachedOnly))
{
stick = new Joystick(input, device.InstanceGuid);
stick.Acquire();
foreach (DeviceObjectInstance deviceObject in stick.GetObjects())
{
if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0)
{
stick.GetObjectPropertiesById(deviceObject.ObjectType).SetRange(-100, 100);
}
}
sticks.Add(stick);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
I'm getting error on the line:
if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0)
Severity Code Description Project File Line Suppression State Error CS0103 The name 'ObjectDeviceType' does not exist in the current
And on the line:
stick.GetObjectPropertiesById(deviceObject.ObjectType).SetRange(-100, 100);
Severity Code Description Project File Line Suppression State Error CS1503 Argument 1: cannot convert from 'System.Guid' to 'SharpDX.DirectInput.DeviceObjectId'