Jump to content

Conditionnal Keyboard F-Lock reg tweak


Recommended Posts

It seems that the tweak to have the F-Lock always on breaks the other keyboard layouts, so I was wondering, perhaps we could try to see if one of the keyboards that needs the tweak is plugged in before applying it? (otherwise not apply the tweak)

The only ones I use that need it are the microsoft office keyboards, they have a Vendor ID of 045e and a Product ID of 0048. So we can check for HKLM\SYSTEM\CurrentControlSet\Enum\USB for subkeys that match that (Vid_045e&Pid_0048) with a script. Actually, we could even search for the actual name (Microsoft® Office Keyboard) but I think it would just tend to not detect sometimes (if the USB device is plugged, it will have a good VID/PID, but if the name is always proper... I'm not 100% sure).

The only thing is, I'm not sure if the keyboard is actually detected at the phase I run my tweaks (GUIRunOnce)... I'll test it soon enough.

Any VID\PID for other keyboard that would benefit from that are more than welcome too.

Anyways. Here's what I'll try:

@echo off
set tmpFile=C:\usb.log
REGEDIT /E tmpFile  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" > nul
find /i "\Vid_045e&Pid_0048]" tmpFile > nul
if errorlevel 1 goto NotNeeded
REGEDIT /S "%cdrom%\install\RegTweaks\FLock.reg"
:NotNeeded
del tmpFile
set tmpFile=

I'm also open to different ideas or a better script.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...