-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced queries for connected devices #145
Comments
Please let me know if you could suggest better methods. |
Just realised a better way to query a connected devicetype would be this:
|
There is some value to this change, but for keyboards, given the different layouts it may simplify the checks too much? |
@brandonscott That is true. For keyboards you may still have to query which device it is. However, lets say you separate out the logic per device type, or simply want to show / hide options based on connected types, then this would definitely be handy. As for layouts, I personally think there should be a definition for each layout, as a few share the same and I'm sure more devices will in the future too. We would then have the ability to query as to which layout it is instead of individual devices. example: switch(Keyboard.Layout){
case Razer.Keyboard.Layouts.Standard:
// do something
break;
case Razer.Keyboard.Layouts.Mini:
// do something else
} We should raise this with Razer if we agree this would make beneficial to most. |
Also, if you wanted keyboard device specific code, you would currently have to do something like this: function Connected(DeviceInfo d){
return c.Query(d).Connected;
}
if(Connected(Razer.Devices.Blackwidow)){
// Do something
}else if(Connected(Razer.Devices.BlackwidowTe)){
// Do something else
}else if(Connected(Razer.Devices.Deathstalker)){
// Do something very different
} Could potentially be shortened to a switch statement: switch(Keyboard.Instance.Device)){
case Razer.Devices.Deathstalker:
// Do something
break;
case Razer.Devices.BlackwidowTe:
// Do something else
break;
case Razer.Devices.Deathstalker:
// Do something
break;
default:
// Keyboard.Instance.Device.None for none connected.
} It just feels cleaner. Granted, in the rare case someone may have two of the same devices / device types connected. |
This is the big issue with having a IIRC we raised this issue with Razer before regarding detecting different physical layouts and their response was basically "Nope, we just expect everyone to only ever have a single of any possible device type connected.". |
Ok, so having created a new method for listing the connected devices, which is just a simple |
Or at least attach the Guid. |
|
Was just asked whether there was an easy way to get the following:
Right now, you can query a specific device with the following:
Corale.Colore.Core.Chroma.Instance.Query(Corale.Colore.Razer.Devices.Tartarus).Connected
I'm proposing and plan to implement the following methods:
Chroma.Instance.Query(Corale.Colore.Razer.DeviceType deviceType).Connected
Chroma.Instance.ConnectedDevices()
which returnsList<DeviceInfo>()
The text was updated successfully, but these errors were encountered: