1

It's a wierd use case, but here's why:

I'm developing an app that uses a keyboard driver that intercepts the scan codes from attached keyboards. (https://www.oblita.com/interception.html)

The dll is being wrapped in a C# wrapper and used in my project. The problem is, whenever the debugger pauses, the key events cannot be processed (since the program is now stopped). This makes navigating while the debugger is paused very difficult. I was wondering if anyone has a clever way to deal with this. If I had some code I could run before the debugger paused at a breakpoint I could just call input.Unload() and stop the driver from intercepting.

I'm just kind of at a loss, and maybe I simply have to continue using my mouse only while the debugger is paused.

awwwwwjay
  • 35
  • 3
  • Any code you execute while debugging will be run. So what if you hit Shift+F9 to open QuickWatch and type `input.Unload()`... but wait, you can't type. – CodeCaster Nov 25 '19 at 13:45
  • I didn't entirely understand the use-case, but there is a way you can execute some code while the code is stuck at the debugger by running it on the intermediate window. – Arun Selin Nov 25 '19 at 13:50
  • 1
    If you don't find any good solution, here's some dumb thought I had: Run your program in a virtual machine with visual studio remote debugger. Attach remotely to the process in the virtual machine which will keep your keyboard free on your host. Actually thinking about it, it's not dumb to separate the debugger from the process if you're involving hardware... – Longoon12000 Nov 25 '19 at 13:52

1 Answers1

0

Modify your source code and insert the statement you want executed input.Unload(); on the line immediately above your breakpoint. Then when your breakpoint is hit, the code you want executed will already have been run. After you are done debugging, remove the statement.

robbpriestley
  • 3,050
  • 2
  • 24
  • 36