3

I have a USB 2.0 LED backlit keyboard which continuously has it's LED's on. Unfortunately, the only way to turn off the LEDs is via hotkeys that require a special FN keyboard key (which isn't accessible via keybd_event API or sendkeys class).

Hence, I'd like to make a Powershell script which either disables or suspends/sleeps the USB port for the keyboard (without reboot) after the keyboard and/or mouse has been idle for 15 minutes or longer.

I know there's a USB selective suspend Windows power-saving feature; however, I'm not sure if I can manually do this via script/code for a specific USB port. If it's not possible, I'm hoping for any other possible way to do something similar or just disable the port/device (without reboot).

I did some Internet searches; but the only thing I could find was how to disable the entire USB hub.

If this is something that can't be done easily via Powershell/Win32 API, then I would like to know how to do it via .NET/C#.

Thanks in advance!

MKANET
  • 573
  • 6
  • 27
  • 51
  • I think this is what you are looking for: http://stackoverflow.com/questions/14690157/turn-off-power-to-usb-port-programmatically – SamFisher83 Dec 24 '13 at 22:08
  • @SamFisher83 I think that would toggle all USB ports at once. Also I’m not sure if this would actually disable the power output on the USB ports. – poke Dec 24 '13 at 22:17
  • Q: Is your goal to "disable the keyboard" ... or to "save power"? I believe the latter is a BIOS-level thing - I don't think you can really control it with either PowerShell or C#: http://www.tomshardware.com/forum/311175-30-ports-shut-power – paulsm4 Dec 24 '13 at 22:36
  • SamFisher83, I think I might not have been clear enough when I said all I could find was how to disable the entire USB hub (which is not what I want). @Paulsm4, Im looking for any way to either disable the usb port or put the port in power saving mode. They both would be a good attempt to disable the LED's on my keyboard. – MKANET Dec 24 '13 at 23:37

0 Answers0