Beispiel #1
0
 public RawInputDevice(HIDUsageSim usage, RawInputDeviceFlags flags, HWND target)
 {
     UsagePage = HIDPage.Simulation;
     Usage = (short)usage;
     Flags = flags;
     Target = target;
 }
Beispiel #2
0
            private static FIELD CreateNewField(BinaryReader br, int index, int fieldOffset, int dataOrDataOffset, GffFieldType fieldType)
            {
                FIELD data;

                switch (fieldType)
                {
                case GffFieldType.BYTE:
                    data = new BYTE(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.CHAR:
                    data = new CHAR(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.WORD:
                    data = new WORD(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.SHORT:
                    data = new SHORT(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.DWORD:
                    data = new DWORD(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.INT:
                    data = new INT(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.DWORD64:
                    data = new DWORD64(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.INT64:
                    data = new INT64(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.FLOAT:
                    data = new FLOAT(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.DOUBLE:
                    data = new DOUBLE(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.CExoString:
                    data = new CExoString(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.ResRef:
                    data = new ResRef(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.CExoLocString:
                    data = new CExoLocString(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.VOID:
                    data = new VOID(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.Struct:
                    int lbl_index = br.ReadInt32();
                    data = new STRUCT(br, br.ReadInt32(), lbl_index);
                    break;

                case GffFieldType.List:
                    data = new LIST(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.Orientation:
                    data = new Orientation(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.Vector:
                    data = new Vector(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                case GffFieldType.StrRef:
                    data = new StrRef(br, fieldOffset + dataOrDataOffset * 12);
                    break;

                default:
                    throw new Exception(string.Format("UNEXPECTED FIELD TYPE \"{0}\", IN STRUCT INDEX \"{1}\"", fieldType, index));
                }

                return(data);
            }
Beispiel #3
0
 public RawInputDevice(HIDUsageGD usage, RawInputDeviceFlags flags, HWND target)
 {
     UsagePage = HIDPage.GenericDesktop;
     Usage = (short)usage;
     Flags = flags;
     Target = target;
 }