mirror of
				https://github.com/Ryujinx/Opentk.git
				synced 2025-11-04 15:05:07 +00:00 
			
		
		
		
	Implement generic Consumer device which returns a button collection
This commit is contained in:
		
							parent
							
								
									7680969ae1
								
							
						
					
					
						commit
						bef43af969
					
				| 
						 | 
				
			
			@ -141,7 +141,8 @@ namespace OpenTK.Platform.Common
 | 
			
		|||
    // Consumer electronic devices
 | 
			
		||||
    internal enum HIDUsageCD
 | 
			
		||||
    {
 | 
			
		||||
        ACPan = 0x0238
 | 
			
		||||
        ACPan = 0x0238,
 | 
			
		||||
        ConsumerControl = 0x01
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Generic desktop usage
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2126,6 +2126,14 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
            Target = target;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public RawInputDevice(HIDUsageCD usage, RawInputDeviceFlags flags, HWND target)
 | 
			
		||||
        {
 | 
			
		||||
            UsagePage = HIDPage.Consumer;
 | 
			
		||||
            Usage = (short)usage;
 | 
			
		||||
            Flags = flags;
 | 
			
		||||
            Target = target;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public RawInputDevice(HIDUsageSim usage, RawInputDeviceFlags flags, HWND target)
 | 
			
		||||
        {
 | 
			
		||||
            UsagePage = HIDPage.Simulation;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -194,6 +194,7 @@ namespace OpenTK.Platform.Windows
 | 
			
		|||
            {
 | 
			
		||||
                new RawInputDevice(HIDUsageGD.Joystick, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window),
 | 
			
		||||
                new RawInputDevice(HIDUsageGD.GamePad, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window),
 | 
			
		||||
                new RawInputDevice(HIDUsageCD.ConsumerControl, RawInputDeviceFlags.DEVNOTIFY | RawInputDeviceFlags.INPUTSINK, window),
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            if (!Functions.RegisterRawInputDevices(DeviceTypes, DeviceTypes.Length, API.RawInputDeviceSize))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue