diff --git a/SpaceNav.cs b/SpaceNav.cs index 79e6015..b87c0cc 100644 --- a/SpaceNav.cs +++ b/SpaceNav.cs @@ -110,7 +110,11 @@ namespace SpaceNavWrapper #region Properties public double Sensitivity { - get => _sensitivity; + get + { + return _sensitivity; + } + set { _sensitivity = value; @@ -120,26 +124,34 @@ namespace SpaceNavWrapper public int Threshold { - get => _threshold; + get + { + return _threshold; + } + set { _threshold = value; spnav_deadzone(value); } } - + public bool Nonblocking { - get => _nonblocking; + get + { + return _nonblocking; + } + set { - _nonblocking = value; - spnav_set_nonblocking(value); + _nonblocking = value; + spnav_set_nonblocking(value); } } - #endregion + #endregion - public void Dispose() + public void Dispose() { if (!isDisposed) { diff --git a/SpaceNavEvent.cs b/SpaceNavEvent.cs index 3a243ff..549c1fd 100644 --- a/SpaceNavEvent.cs +++ b/SpaceNavEvent.cs @@ -13,24 +13,63 @@ namespace SpaceNavWrapper public MotionEventArgs(int x, int y, int z, int rx, int ry, int rz) { - axisValues = new Dictionary - { - [SpaceNavAxis.X] = x, - [SpaceNavAxis.Y] = y, - [SpaceNavAxis.Z] = y, - [SpaceNavAxis.Rx] = rx, - [SpaceNavAxis.Ry] = ry, - [SpaceNavAxis.Rz] = rz - }; + axisValues = new Dictionary(); + axisValues[SpaceNavAxis.X] = x; + axisValues[SpaceNavAxis.Y] = y; + axisValues[SpaceNavAxis.Z] = y; + axisValues[SpaceNavAxis.Rx] = rx; + axisValues[SpaceNavAxis.Ry] = ry; + axisValues[SpaceNavAxis.Rz] = rz; } - - public int X => axisValues[SpaceNavAxis.X]; - public int Y => axisValues[SpaceNavAxis.Y]; - public int Z => axisValues[SpaceNavAxis.Z]; - public int Rx => axisValues[SpaceNavAxis.Rx]; - public int Ry => axisValues[SpaceNavAxis.Ry]; - public int Rz => axisValues[SpaceNavAxis.Rz]; - + + public int X + { + get + { + return axisValues[SpaceNavAxis.X]; + } + } + + public int Y + { + get + { + return axisValues[SpaceNavAxis.Y]; + } + } + + public int Z + { + get + { + return axisValues[SpaceNavAxis.Z]; + } + } + + public int Rx + { + get + { + return axisValues[SpaceNavAxis.Rx]; + } + } + + public int Ry + { + get + { + return axisValues[SpaceNavAxis.Ry]; + } + } + + public int Rz + { + get + { + return axisValues[SpaceNavAxis.Rz]; + } + } + public override string ToString() { return string.Format("x={0} y={1} z={2} rx={3} ry={4} rz={5}", X, Y, Z, Rx, Ry, Rz);