Unfortunately, no. Our requirement is to only display the SIP if the
keyboard is not present.
Drew
You might try some of the bits hinted at by "USB Function Controller Driver
Bus Interface" in the Platform Builder help for CE5. Generally, though,
there's no interface to see if a given HID device is there or to talk to HID
devices, as there would be on the desktop.
Paul T.
> Unfortunately, no. Our requirement is to only display the SIP if the
> keyboard is not present.
[quoted text clipped - 25 lines]
>>>
>>> Drew
DrewCE - 30 Aug 2007 23:30 GMT
Thanks for the help.
Just to follow up a bit. I was able to partially acheive my goal.
I'm able to poll through the active drivers in the registry. If a keyboard
driver is present, I can assume that a keyboard is attached.
Here is the code I created:
/// <summary>
/// Polls the registry to see if any keyboard drivers are active. If yes,
/// then it assumes that there is a keyboard attached.
/// </summary>
/// <returns><see cref="true"/> if keyboard was detected.</returns>
public static bool IsPresent()
{
bool isPresent = false;
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"Drivers\Active");
string[] activeDrivers = rk.GetSubKeyNames();
foreach (string subKeyName in activeDrivers)
{
RegistryKey subKey = rk.OpenSubKey(subKeyName);
try
{
string val = subKey.GetValue("key") as string;
if (val is string && val.EndsWith("Keyboard"))
{
isPresent = true;
break;
}
}
catch { } //no action
}
return isPresent;
}
No warranties implied,
Drew
> You might try some of the bits hinted at by "USB Function Controller
> Driver Bus Interface" in the Platform Builder help for CE5. Generally,
[quoted text clipped - 32 lines]
>>>>
>>>> Drew