Example #1
0
        // Get absolute value / limits
        public static int GetAbs(int fd, EvdevAxis axis, out InputAbsInfo info)
        {
            info = default(InputAbsInfo);
            unsafe
            {
                fixed(InputAbsInfo *pinfo = &info)
                {
                    // EVIOCGABS(abs) = _IOR('E', 0x40 + (abs), struct input_absinfo)
                    uint ioctl  = IOCreate(DirectionFlags.Read, (int)axis + 0x40, BlittableValueType <InputAbsInfo> .Stride);
                    int  retval = Libc.ioctl(fd, ioctl, new IntPtr(pinfo));

                    return(retval);
                }
            }
        }
        // Get absolute value / limits
        public static int GetAbs(int fd, EvdevAxis axis, out InputAbsInfo info)
        {
            info = default(InputAbsInfo);
            unsafe
            {
                fixed(InputAbsInfo *pinfo = &info)
                {
                    // EVIOCGABS(abs) = _IOR('E', 0x40 + (abs), struct input_absinfo)
                    var ioctl  = IOCreate(DirectionFlags.Read, (int)axis + 0x40, Marshal.SizeOf <InputAbsInfo>());
                    var retval = Libc.ioctl(fd, ioctl, new IntPtr(pinfo));

                    return(retval);
                }
            }
        }
Example #3
0
 // Get absolute value / limits
 public static int GetAbs(int fd, EvdevAxis axis, out InputAbsInfo info)
 {
     info = default(InputAbsInfo);
     unsafe
     {
         fixed (InputAbsInfo* pinfo = &info)
         {
             // EVIOCGABS(abs) = _IOR('E', 0x40 + (abs), struct input_absinfo)
             uint ioctl = IOCreate(DirectionFlags.Read, (int)axis + 0x40, BlittableValueType<InputAbsInfo>.Stride);
             int retval = Libc.ioctl(fd, ioctl, new IntPtr(pinfo));
             return retval;
         }
     }
 }