在我的应用程序内部处理热键,无需全局热键 [英] Handle hotkeys internally in my app without global hotkey
问题描述
您好,我正在尝试在我的应用程序中处理热键而不是依赖全局热键。
我想采取原始输入并检查。用于热键组合的txt文件。如果找到匹配,则执行操作。
目前我的.txt文件存储的行包括修饰键,键和文件路径(将用于操作) 。
Ctrl + Shift $ F $ C:/notepad.exe$
热键我'我将允许使用Ctrl + Shift + F,Shift + F,F(两个修饰符和一个键是最大值)等形式。
原因我想要使用rawinput而不是全局热键是在全屏幕运行时阻止全局热键的一些程序。
有人能想到更容易/更好的方法吗?
我尝试了什么:
我试过每2次搜索或者从原始输入报告的3个键。不幸的是,由于搜索重叠,它会错过组合。即rawinput报告W,Ctrl,Shift,F按2或3键搜索将不会返回任何结果,因为搜索W,Ctrl和W,Ctrl,Shift都不会找到结果。
Hello, I'm trying to handle hotkeys within my application instead of relying on global hotkey.
I would like to take raw input and check against a .txt file for hotkey combinations. If a match is found then perform an action.
Currently my .txt file stores lines including the modifier key, key and filepath(which will be used for the action).
Ctrl+Shift$F$C:/notepad.exe$
The hotkeys I've allowed will be in forms such as Ctrl+Shift+F, Shift+F, F(Two modifiers and one key is the maximum).
Reason I want to use rawinput rather than global Hotkeys is down to some programs blocking global hotkeys when running in full screen.
Can anyone think of an easier/better way to do this?
What I have tried:
I've tried searching every 2 or 3 keys reported from raw input. Unfortunately it will miss combinations due to overlapping searches. Ie rawinput reports "W,Ctrl,Shift,F" search by 2 or 3 keys would return no result due to searching "W,Ctrl" and "W,Ctrl,Shift" neither of which would find a result.
推荐答案
F
C:/notepad.exe
C:/notepad.exe
我允许的热键将采用Ctrl + Shift + F,Shift + F,F等形式(两个修饰符和一个键是最大值)。
原因我想使用rawinput而不是全局热键是在全屏运行时阻止全局热键的一些程序。
任何人都可以想一个更简单/更好的方法吗?
我尝试过的事情:
我试过搜索原始输入报告的每2或3个键。不幸的是,由于搜索重叠,它会错过组合。即rawinput报告W,Ctrl,Shift,F按2或3键搜索将不会返回任何结果,因为搜索W,Ctrl和W,Ctrl,Shift都不会找到结果。
The hotkeys I've allowed will be in forms such as Ctrl+Shift+F, Shift+F, F(Two modifiers and one key is the maximum).
Reason I want to use rawinput rather than global Hotkeys is down to some programs blocking global hotkeys when running in full screen.
Can anyone think of an easier/better way to do this?
What I have tried:
I've tried searching every 2 or 3 keys reported from raw input. Unfortunately it will miss combinations due to overlapping searches. Ie rawinput reports "W,Ctrl,Shift,F" search by 2 or 3 keys would return no result due to searching "W,Ctrl" and "W,Ctrl,Shift" neither of which would find a result.
这篇关于在我的应用程序内部处理热键,无需全局热键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!