How can I disable the F Lock key on my Natural Keyboard 4000?

Jason Tsang maintains a registry edit for Intellitype Pro keyboards to disable the F-lock key.


The answer from @JNK led me to the URL below which describes how to simulate disabling the F Lock key by changing the configuration of IntelliType Pro.

  • http://jtsang.mvps.org/usb_intellitype.html

The files on that page are specific to an older version of IntelliType and so I was apprehensive about using them incase I lost some other functionality from IntelliType. However, by comparing the original and modified files supplied there, I was able to write the following PowerShell 2 script which will make the equivalent changes to the commands.xml file for whichever version of IntelliType you happen to have installed.

If you don't know anything about PowerShell, then will probably be useless to you. If you do understand PowerShell - enjoy!

#requires -version 2
set-strictmode -version latest

$keyCodes = @(302, 203, 204, 307, 308, 309, 900, 901, 902, 401, 311, 310)
$matchRegex = '^\s*<C({0})\s.*$' -f ($keyCodes -join '|')

# This used to be:
#   $filename = "$env:ProgramFiles\Microsoft IntelliType Pro\commands.xml"
$fileName = "$env:ProgramFiles\Microsoft Mouse and Keyboard Center\commands.xml"
$backupFileName = $fileName -replace "\.xml$", ".original.xml"

if (-not (test-path $backupFileName)) {
    write-verbose "Backing up commands.xml"
    cp $fileName $backupFileName
}

$file = (get-content $fileName) -replace $matchRegex, ""

$xml = [xml]$file
$allAppsStd = $xml.DPGCmd.ALL.Application |
    ?{ $_.UniqueName -eq "StandardSupport" }

$nextFKey = 1

$keyCodes | %{
    $elemName = "C{0}" -f $_
    $fkey = "F{0}" -f $nextFKey

    $nextFKey++

    $new = $xml.CreateElement($elemName)

    $new.SetAttribute("Type", "5")
    $new.SetAttribute("KeySeq", $fkey)

    $allAppsStd.AppendChild($new) | out-null
}

$xml.Save($fileName)

The advice on Jason's Intellitype page didn't work on Windows 7. I re-mapped the functions of the keys (help, undo, etc.) to the actual Function keystroke using the keyboard software provided. Hit configure, choose from list of commands, keystroke... the the required F key when the window pops, & ok.

Tags:

Keyboard