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

[Bug] Keys don't seem to work properly when they're pressed for <=1ms #153

Open
lucordes opened this issue Apr 15, 2023 · 8 comments
Open
Labels
accepted Requirement understood and waiting implementation. bug Something isn't working help wanted Extra attention is needed

Comments

@lucordes
Copy link

About Bug

Steps to reproduce

  1. I'm using a programmable keyboard running on zmk.dev firmfare.

Environments

|Windows Edition|10 Home|
|Architecture|[e.g. 64bit/32bit]|
|win-vind Version|[e.g. 5.0.1.0]|

@pit-ray
Copy link
Owner

pit-ray commented Apr 17, 2023

Do I need to buy some keyboards to reproduce it?
Could you tell me details more?

Thanks.

@lucordes
Copy link
Author

It is a keyboard running https://github.com/zmkfirmware/zmk firmware. It is workin for me now. I created deticated macros for each key to press the keys for 20ms. It does not look as nice but it works. This issue could be related zmkfirmware/zmk#759 . Thank you very much for your great extention. Can this issue be closed?

@pit-ray
Copy link
Owner

pit-ray commented Apr 17, 2023

Thanks for details.

Am I correct in understanding that this isuue is caused by mismatch of I/O timing between zmk and win-vind?

win-vind uses hardcoded interval, but modifilable, but I have not tried yet.

@lucordes
Copy link
Author

I only press my keys on my programmable keyboard for 1ms it seems.
If I sleep for 0ms it works but 5 or 1 ms doesn't work. Downside is that my cpu is at 33%.
constexpr auto REPEAT_SAMPLING_DELTA_US = 25'600 ;
Does not appear to make a change.

@lucordes
Copy link
Author

I can wait for minmal 1ms. Nothing helps.
Waiting ms would be nice but std::this_thread::sleep_for(std::chrono::microseconds(100)); waits a ms.

@pit-ray
Copy link
Owner

pit-ray commented Jun 16, 2023

Did your std::this_thread::sleep_for work?
If necessary I will create a version with modifiability for tests.

@lucordes
Copy link
Author

I'd did not work. std::this_thread::sleep_for(std::chrono::microseconds(100)); sleeps for 1ms. And it does not work consistently. I'm not sure what you mean. I'm using a macros to artificial extend the tapping time to 20ms and it works consistently.
Thanks for your activity on this program I use it every day.

@pit-ray
Copy link
Owner

pit-ray commented Jun 16, 2023

Thanks for using win-vind.

Looking at Stack Overflow, it still seems to be difficult to get Windows to sleep for an exact short period of time.
If you find a better solution, please send a pull request.

@pit-ray pit-ray added bug Something isn't working wontfix This will not be worked on labels Jun 16, 2023
@pit-ray pit-ray added help wanted Extra attention is needed accepted Requirement understood and waiting implementation. and removed wontfix This will not be worked on labels Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Requirement understood and waiting implementation. bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants