Empiree / DeftSharp.Windows.Input

An open-source .NET library designed for keyboard and mouse control in Windows.
MIT License
73 stars 21 forks source link

Created KeyboardManipulator tests for SetInterval, ResetInterval, and ResetIntervals #47

Closed AdielRoyt closed 6 months ago

AdielRoyt commented 6 months ago

In order to allow for the KeyboardManipulator tests to access intervals, an enumerable key was created KeyPressIntervals in KeyboardManipulator.cs and KeyboardIntervalInterceptor.cs, allowing the KeyboardManipulator class access to the key press intervals from KeyboardIntervalInterceptor.cs. All of the 3 new tests have passed, with all 5 previous tests still passing as well

Screenshot 2024-05-14 210816

Empiree commented 6 months ago

Hey @AdielRoyt !

I'm glad you are interested in this project :)

Great idea to create a collection with intervals! I think this collection could be converted into a dictionary, so that in addition to the keys, users could also get the interval set for them, maybe some users would find this very useful!

Also, we can improve the tests, and add a check for SetInterval(key, TimeSpan.Zero) - when using this method, if an interval has been applied to a key it will be removed, this call is analogous to ResetInterval(key)

I also propose to put the interval tests in a separate class, which could be called KeyboardManipulatorIntervalTests

I accept this PR, but if you have a desire to improve and add what I described above, you can open a new PR and make those changes. Thanks for your contribution! :)

AdielRoyt commented 6 months ago

You are absolutely welcome :) I'll take your feedback into consideration.