Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one virtual keyboard? #21

Open
MuhammedZakir opened this issue Sep 26, 2021 · 3 comments
Open

More than one virtual keyboard? #21

MuhammedZakir opened this issue Sep 26, 2021 · 3 comments

Comments

@MuhammedZakir
Copy link

MuhammedZakir commented Sep 26, 2021

Is it possible to create more than one virutal keyboard? In other words, Is it possible to create unique virtual keyboard, each corresponding to a captured (physical) keyboard?

I have encountered a problem when using a single virutal keyboard for more than one keyboard.

To reproduce:

  1. Press a modifier key, e.g. shift, on a keyboard (keyboardA).
  2. Press a key, e.g. f, on another keyboard (keyboardB).
  3. This will produce F.
  4. However, now, subsequent presses on keyboardB will produce non-shifted letter (e.g. f), rather than shifted letter (e.g. F).
  5. But on keyboardA, the first keypress after #2 will produce a non-shifted letter, and subsequent keypresses on that keyboard will produce shifted letters.

tl;dr -- holding a modifier key on 1 keyboard, and pressing a key on another keyboard creates problem.

Details:

  1. Dext version: 1.15.0
  2. Uses report.keys.insert for all keys.
    • Does that create problems when used for modifier keys?
    • Anyway, I will try to use report.modifiers.insert instead to see if it solves the problem.
  3. Tried using a single socket, and unique socket per device.
    • Doesn't solve the problem.
  4. Code: https://github.com/kmonad/kmonad/blob/master/c_src/mac/dext.cpp
@MuhammedZakir
Copy link
Author

@tekezo: Any suggestion/advice?

@tekezo
Copy link
Member

tekezo commented Oct 20, 2021

I changed to create new virtual device for each pqrs::karabiner::driverkit::virtual_hid_device_service::client since Karabiner-DriverKit-VirtualHIDDevice 1.24.0.

Example:
https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/blob/main/examples/virtual-hid-device-service-client/src/main.cpp

@MuhammedZakir
Copy link
Author

Thank you very much! :-)


What is the difference between using report.keys.insert and report.modifiers.insert for modifiers? KMonad is using the former, so I am wondering whether that would create any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants