c# - Does Windows 10 have a registry entry for LowLevelHooksTimeout -


i'm trying find workaround issue i'm having when debugging c# in visual studio 2015. when application debugging cause mouse cursor severely lag when breakpoint hit. because application registers hooks mouse , keyboard. when breakpoint hit hooks waiting input won't receive until timeout reached (~5 seconds).

therefore, found solutions online, nothing relatively straightforward implement without reworking hooks. tried adding registry entry lowlevelhookstimeout see if windows more move on next hook event when breakpoint hit, doesn't seem make difference.

alternatively, using raw input might way go, require bit of work. has run issue , there solutions readily available chance.

https://social.msdn.microsoft.com/forums/windowsdesktop/en-us/f6032ca1-31b8-4ad5-be39-f78dd29952da/hooking-problem-in-windows-7?forum=windowscompatibility

https://security.stackexchange.com/questions/78732/unregistering-keyboard-hooks-by-timeout-expiration

i ended going open-source code: http://www.codeproject.com/articles/17123/using-raw-input-from-c-to-handle-multiple-keyboard

it has raw input api implemented in c#. there's simple wpf app in there gives device info , such when press keys (that's in screenshots @ given link). used underlying code , integrated application. example:

if (rawinputhandler == null) {     rawinputhandler = rawinput.instance;      rawinputhandler.loggingevent += rawinputhandler_loggingevent;     rawinputhandler.keypressed += rawinputhandler_keypressed;     rawinputhandler.mousepressed += rawinputhandler_mousepressed; } 

meanwhile, in raw input side of things, invoke these events whenever detect relevant event come down pipe. there's method called processrawinput(intpr) differentiate between mouse, keyboard, etc. done via checking hardware type in api's buffer header:

if (_rawbuffer.header.dwtype == devicetype.rim_type_mouse) {     // mouse stuff, invoke event } 

it pain, in end api solved debugging horror of using mouse/keyboard hooks.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -