简体   繁体   中英

.NET disable keyboard shortcuts - from a SPECIFIC input device

I would like to disable, with run-time configurability, various keyboard combinations (Alt+Tab, Ctrl+F, etc.) from the primary keyboard on Windows.

I'd still like to be able to emulate these key combinations through software-based means, such as the approach shown at https://inputsimulator.codeplex.com/ .

Every example I've found disables the key combinations completely, but I only want to disable the key combinations if they come from the main keyboard.

Any thoughts on the feasibility of this? My current prototype is a .NET service that is written in C#.

What you're asking for is not possible. Windows discards the device ID early in keyboard processing; by the time it reaches user mode (a low-level keyboard hook, say) the device ID is gone. Raw Input lets you track the device-specific input, but doesn't let you block it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM