在 Windows 7 上取消设置热键(键盘快捷键)

在 Windows 7 上取消设置热键(键盘快捷键)

运行 Win7 Pro/64。每次我不小心按下AltGr + dAltGr是右键Alt)时,就会弹出“Fujitsu Display Manager”,这个实用程序在需要时可能会有用,但在无意中调出时则无用。无论焦点在哪个程序上,都会发生这种情况:浏览器、命令提示符,甚至 GVim。我想我可以通过卸载 Fujitsu 实用程序来解决这个问题。不幸的是,我是那种希望通过了解事物的工作原理来控制的人。所以我更想知道如何禁用热键。有什么建议吗?

答案1

我找到了答案!虽然我怀疑有一些注册表项存储了所有热键(实际上可能有一些注册表项确实如此),但这并不是人们在处理此类问题时所遵循的方法。相反,似乎和其他页面,通过属性对话框输入热键快捷方式(但不是直接程序)。

因此,我所要做的就是找到富士通显示管理器的开始菜单快捷方式,打开其属性对话框,然后禁用热键。确实如此!使用 Explorer,我导航到C:\ProgramData\Microsoft\Windows\Start Menu,进一步向下找到相关程序的相应条目,然后打开属性对话框。更改热键设置需要管理员权限,因此快速 UAC,问题就解决了!

我仍然相信所有这些热键都必须有一个集中存储,而且我仍然认为它在注册表中,所以如果有人能指出这一点,那就是我要接受的答案。

更新:我不再相信登记理论。似乎是:“它不存储在注册表中。它是在登录时计算并保存在内存中。”这意味着每次登录时都会进行文件系统扫描,我们都知道这种扫描确实在发生,因此这种扫描理论与我们的经验相符。我还没有找到令人信服的解释来解释为什么会这样,但我目前掌握的信息已经足够了。我仍然认为将信息存储在注册表中会更好,但我不是微软程序员。

答案2

如果您有任何编程经验,这并不像看起来那么难。

您可以使用SetWindowsHookEx()注册一个全局钩子,然后检查每个回调类型。如果它不是您要阻止的热键,只需调用CallNextHookEx()以将消息传递到队列中。当您检测到热键时,默默地丢弃消息并且不调用下一个钩子。

但是,我不知道有适合非程序员的解决方案。

答案3

您可以使用快捷键资源管理器获取所有应用程序快捷方式的列表。

我们创建了快捷键资源管理器来帮助您管理计算机上加载的快捷键列表。只需运行快捷键资源管理器,它就会自动加载现有快捷键并将它们显示在易于阅读的列表中。从此列表中,您可以双击任何项目并编辑 Windows 快捷方式的属性。这对于排除重复的快捷键或您甚至不知道存在的快捷键非常有用。
http://www.rjlsoftware.com/software/utility/shortcutkeys/

答案4

我有一些 vb 代码,可以查找已添加到快捷方式的热键。

我发现的问题是,可以包含“热键”快捷方式的文件夹列表似乎不清楚。此外,有些位置似乎有我从未放在那里的“缓存”快捷方式,但似乎启用了组合键。此外,您需要对搜索的文件夹具有读取权限。

由于找不到我正在寻找的“僵尸”热键,我随着时间的推移添加了几个文件夹。

我希望我输入的代码正确。

将代码保存为带有 .vbs 扩展名的文本文件。打开文件。它会运行。它会递归地查看文件夹和子文件夹列表。某些错误会被忽略,例如权限错误。

它会查找所有以 .lnk 结尾的文件。它会检查每个 .lnk 文件是否有热键。

如果文件有热键,则该文件将被添加到消息框显示的消息字符串中。

希望这有帮助。这是代码:

OPTION EXPLICIT

' ms "starting"  ' ms is a message box sub with vbcr cancel 
'234567890'234567890'234567890'234567890'234567890'234567890'234567890'234567890  scale helps debugging error messages


' special folders

      ' AllUsersDesktop
      ' AllUsersStartMenu
      ' AllUsersPrograms
      ' AllUsersStartup
      ' Desktop
      ' Favorites
      ' Fonts
      ' MyDocuments
      ' NetHood
      ' PrintHood
      ' Programs
      ' Recent
      ' SendTo
      ' StartMenu
      ' Startup
      ' Templates

dim recurseCount

DIM rc
DIM lnkString
DIM strFolder
DIM  IncludeSubFolders
DIM objFSO
Dim objNetwork
Dim objShell
Dim msg
Dim HotKeyCount
HotKeyCount = 0
' ************************************************************
' Setup
' ************************************************************
SET objShell = CREATEOBJECT("wscript.shell")

SET objFSO = CREATEOBJECT("Scripting.FileSystemObject")
Set objNetwork = CreateObject("WScript.Network")
SET objFSO = CREATEOBJECT("Scripting.FileSystemObject")
lnkString = ""
recurseCount = 0

' finally found the short that had the zombie hot key in
' --> C:\Users\pkryder\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
' it was also in --> C:\Users\pkryder\AppData\Roaming\Microsoft\IMJP10
' how why?


' C:\ProgramData\Microsoft\Windows
      strFolder = "C:\ProgramData\Microsoft\Windows\" ' objShell.SpecialFolders.Item ("Templates")
FindHotKeys strFolder


' C:\ProgramData\Microsoft\Windows
      strFolder = "C:\users\" ' objShell.SpecialFolders.Item ("Templates")
FindHotKeys strFolder




strFolder = objShell.SpecialFolders.Item("AllUsersStartup")
FindHotKeys strFolder

strFolder = objShell.SpecialFolders.Item("Programs")
FindHotKeys strFolder

strFolder = objShell.SpecialFolders.Item("Desktop")
FindHotKeys strFolder


'      "AllUsersDesktop"
strFolder = objShell.SpecialFolders.Item("AllUsersDesktop")
FindHotKeys strFolder

      ' AllUsersStartMenu
strFolder = objShell.SpecialFolders.Item ("AllUsersStartMenu")
FindHotKeys strFolder


      ' AllUsersPrograms

strFolder = objShell.SpecialFolders.Item ("AllUsersStartMenu")
FindHotKeys strFolder

      strFolder = objShell.SpecialFolders.Item ("AllUsersStartup")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Desktop")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Favorites")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Fonts")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("MyDocuments")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("NetHood")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("PrintHood")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Programs")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Recent")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("SendTo")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("StartMenu")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Startup")
FindHotKeys strFolder
      strFolder = objShell.SpecialFolders.Item ("Templates")
FindHotKeys strFolder













if lnkString = "" then 
    ms "no hotkeys wer found"
else
    if HotKeyCount = 1 then 
            ms "done " &vbcr & HotKeyCount & " hotKey was found " & vbcr & lnkString
    else
        ms "done " &vbcr & HotKeyCount & " hotKeys were found " & vbcr & lnkString
    end if
end if




SUB FindHotKeys(BYVAL strDirectory)
    DIM objFolder 
    DIM objSubFolder
    DIM objFile
    DIM strExt
    DIM errSav 
    Dim n1 
    Dim ws1
    Dim errSav2
    dim errSav3
    dim bIsAshortcut
    Dim n2
    Dim n3
    Dim intMsgSave



    n3 = 9999
    n2 = 9999
    n1 = 9999
    ws1 = n1
    dim FileCount
    dim SubFolderCount

on error goto 0

errSav = 0
errSav2 = 0 
errSav3 = 0
bIsAshortcut = false



msg = "strDirectory" & vbcr & vbcr & strDirectory
' ms msg & vbcr & "076"

'234567890'234567890'234567890'234567890'234567890'234567890'234567890'234567890  scale helps debugging error messages
on error goto 0
on error resume next 

SET objFolder = objFSO.GetFolder(strDirectory)
errSav = err.number

FileCount =  objFolder.files.count
errSav2 = err.number
SubFolderCount = objFolder.SubFolders.count
on error goto 0


msg = msg & vbcr & "errSav2:" & errSav2 & vbcr & "errSav:" & errSav 
msg = msg &  vbcr & "FileCount:" & FileCount 
msg = msg &  vbcr & "SubFolderCount:" & SubFolderCount

' ms msg & vbcr & "092"


If errSav = 0 then  ' we have subfolders

    on error resume next 
    FOR EACH objSubFolder in objFolder.SubFolders
            errSav2 = err.number
            on error goto 0
            If errSav2 = 0 then  
            ' ms "102" 
                recurseCount = recurseCount + 1
                FindHotKeys objSubFolder.Path ' recurse through this new sub folder
                recurseCount = recurseCount - 1
            ' ms "110"
            end if  
            on error resume next 
    NEXT
    on error goto 0

'   ms "115" & vbcr & "in files" & vbcr& vbcr & strDirectory 

    n2 = 0
    on error resume next '      had some trouble with file not found? so ignore that
    FOR EACH objFile in objFolder.Files
            errSav = err.number
            n2 = n2 + 1
            dim sObjFileName
            dim iLength
            sObjFileName = objFile.name
            errSav3 = err.number
            on error goto 0
            iLength = len(sObjFileName)

            bIsAshortcut = false
            if (right(sObjFileName,4) = ".lnk")  then ' look only at the end of the string
                bIsAshortcut = true
                '  msgbox ">" & objFile.name & "<"
                else                                   ' something had .lnk embedded but not at the end
                if instr(sObjFileName,".lnk") > 0 then
                   msgbox  strDirectory & vbcr & ">" & objFile.name & "<"  & vbcr &  s'? who has lnk not at end of name
                end if
            end if 





            if bIsAshortcut  Then
                dim lnk
                dim filePath
                filepath = strDirectory & "\" & objFile.name
                ' ms "128  have an lnk file " & vbcr & filePath
                dim hotKey
                set lnk = objShell.CreateShortcut(filepath) 
                errSav2 = err.number
                hotKey = lnk.hotkey 
                if hotKey <> "" then
                    ';ms "129" & vbcr & "errSav2:" & errSav2    & vbcr & "hotKey:" & hotKey
                    HotKeyCount = HotKeyCount + 1
                    if len(lnkString) > 900 then
                        msgbox len(lnkString) & vbcr & lnkString
                        lnkString = ""
                    end if
                    if instr(lnkString,strDirectory & " | ") = 0 then
                        lnkString = lnkString & vbcr & vbcr &  "-" &  vbcr & strDirectory & " | " ' put blank and bar on the end to differentiate sub directories
                    else
                    end if
                    lnkString = lnkString & vbcr & HotKeyCount & " " & hotKey & "  " & objFile.name 
                    'ms "138" & lnkString
                    ' save to text file
                end if
            END IF
        on error resume next 

     NEXT

END IF


END SUB


sub ms(BYVAL m)
'   rc = msgbox ( "recurseCount:"&recurseCount & vbcr & vbcr & m , vbcrOKCancel)
    rc = msgbox (  m , vbOKCancel)
    if rc = vbCancel then wscript.quit

end sub

相关内容