示例#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);
                }
            }
        }
示例#3
0
文件: Evdev.cs 项目: RockyTV/opentk
 // 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;
         }
     }
 }