keyplus icon indicating copy to clipboard operation
keyplus copied to clipboard

Port keyplus emulator to windows

Open ahtn opened this issue 6 years ago • 0 comments

Two approaches that might work:

Method 1 - Input APIs

  • Raw Input to read HID codes from devices
  • BlockInput to prevent the original behaviour of keys being generated
  • SendInput to generate new keyboard/mouse events.

Pros:

  • runs in user-space
  • should be easy to implement.

Cons:

  • BlockInput and SendInput don't work when a UAC prompt is active, nor when Ctrl+Alt+Del combination is used.
  • BlockInput blocks all input devices, so need to forward events of all devices that we aren't remapping.
  • Might not work correctly with some applications depending on how they handle keyboard input.

Method 2 - Filter driver

Write a Keyboard and Mouse Filter Drivers.

Pros:

  • The OS should treat the virtual keyboard and mouse the same way as real hardware.
  • Should work in UAC and when Ctrl+Alt+Del is pressed.

Cons:

  • Filter drivers run in kernal-space, so harder to work with. A driver crash means the OS crashes, aka BSOD.
  • A user-space program to communicate with the driver will be needed, so more complexity.
  • Might be harder to install??

Other considerations

Microsoft's C compiler MSCV only has partial support for C99, so some keyplus code may not compile. To work around, will need to either rewrite some code, or compile it as C++ code.

ahtn avatar Jun 04 '19 12:06 ahtn