-
Notifications
You must be signed in to change notification settings - Fork 152
Add various Filters for Key Callback and and provide a Framework to create new Filters #8
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
base: master
Are you sure you want to change the base?
Conversation
Hello Dean, I implemented another feature (Tempo-mode), i.e. distinguishing between long and short key presses. |
Thanks, the pull request looks better now. I'm wondering if this belongs in a pluggable filter, rather than inside the core library, so that people can opt-into whatever filters they want with the parameters they want. Something like a |
Hi Dean, I need to look into this and come back to you. It will take some time, since started with Python 14 days ago. So I am new to filter-concepts. kind regards |
You're doing extremely well then, I didn't mean to be discouraging - I appreciate the project interest and your contribution. I'm just thinking of how to generalise this some more, to make it extensible to all the various use cases. I'll clean up and merge this tonight, and you can keep looking at the filter concept as a good Python learning task. |
Hi Dean, sorry for the long radio frequency. I did write a lot of Python code during the holidays. Now I only find some time on the weekends, that is the only reason I said, it will take some time. I kept thinking about it and identified several possible solutions. I now started coding my favorite solution, But it still needs some code refactoring. Most likely I will finish it next weekend. |
Hi Dean, I am finally kind of happy with the implementation of Filter Plugin you proposed. Let me try to explain what I had in mind
How to move on:
|
Dear Dean,
Works from my side. let me know what you think of it |
Hi Dean, I observed, that json.Encoder support will be crucial to make any button settings persistent, that include a StreamDeckFilter object. |
Fancy! Certainly a lot more involved than I was expecting. We have a long weekend coming up in a day and a bit - I'll have a proper go through then and try to fully understand your implementation. Some questions:
|
Hi Dean, Q1&2 show that I need to provide a more detailed documentation and an example I appreciate very much, that you take some time to look into the implementation. |
Hello Dean,
I have done the best to create a base for you to revise the whole stuff at the weekend. Regarding the example:
Regarding Q2. |
Had a look at this the other day - I dig the functional style of programming. It seems to interact poorly with the demo at the moment with the more exotic filters, as they are only triggering on button state changes (so pressing the button with some of the delay filters applied doesn't reset the button state after a while). I need to look into proper event scheduling in python, as I think for these to work natively we would need to schedule future callbacks to, for example, reset the key states after the button is released and the filter period has elapsed. Originally I never bothered to implement anything like this, as I expected the application layer using my API to implement whatever scheduling it deems necessary. The easiest way I can see to do this would be to go all-in on |
Hi Dean, I also observed that we need timed callbacks for DebounceFilter (see my previous comment). I understood, that you like to look into that. Here is a stupid question:
isn't that the whole idea of set_key_callback_async? |
e2517f9
to
cc07a48
Compare
Reintegrated StreamDeckFilter into the current version. Please revisit and decide if this fits at all |
Oops - I was on a two week holiday and mean to get back to this when I got back a week ago, sorry! As you've seen, I've been fiddling with the project structure somewhat. For the filtering, I'm thinking of putting these in a |
Thx Dean, I didn't mean to be pushy. I took off from coding for 3 weeks myself and now restarted and wanted to know about the plans. ;-) |
No it's my fault for failing to follow up, between long travel times and multiple projects at work I don't have a lot of time or brain space these days :(. I don't have any real concrete plans currently, but with the refactoring I did for the StreamDeck Mini support plus the helper classes and PyPi packaging I think the optional filter helpers is the way to go, since it gives the best flexibility and allows the library users to integrate it into their own event loops/timer threads to handle the time-dependent filters. |
2nd try to file a Pull Request
Removing Chattering:
New callbacks are only made after a 3ms back delay/cooldown for that key.