在运行时使用MouseKeyHook取消注册热键

时间:2020-11-04 22:34:03

标签: c# wpf winforms mousekeyhook

我想允许用户在运行时重新分配热键,并且正在使用let g:ale_python_flake8_options = '--max-line-length=88' NuGet程序包。

在运行时创建新的热键效果很好,但清除已分配的createContext() / useState的{​​{1}}(通过设置其import React, { createContext, useContext, useState } from "react"; const SidebarContext = createContext(); function Provider({ children }) { let [isVisible, setIsVisible] = useState(false); let toggle = useCallback(() => setIsVisible(s => !s), [setIsVisible]) // Pass the `state` and `functions` to the context value return ( <SidebarContext.Provider value={{ isVisible, toggle }}> {children} </SidebarContext.Provider> ); } function YourButton() { let { isVisible, toggle } = useContext(SidebarContext); return ( <div> <div>Sidebar is {isVisible : 'open': 'close'}</div> <button onClick={toggle}> Toggle </button> </div> ); } function App() { return ( <Provider> <YourButton /> </Provider> ); } )不会删除原始作业。

是否有某种方法可以按Gma.System.MouseKeyHook / Action进行此操作?更具体地说,我想避免在Combination引用上调用Sequence,而不必重新初始化整个系统分配。

任何帮助将不胜感激:)

1 个答案:

答案 0 :(得分:2)

如果您要退订按键事件:

Address

编辑:

据我了解,您致电OnCombination。 在检查完此方法的代码之后,您无法在创建组合列表后对其进行更改。其他对OnCombination的调用只会添加更多注册。

编辑:

另一种选择是使用reactive extensions

to

Nuget软件包:

from

MouseKeyHook.Rx仍处于预发行版本。