This sat on my inbox and back burner for far too long :/
On the legs of some comments left in #3722 it became apparent that current "input system" darktable has is a bit "hacky" and requires loads of boilerplate code + isn't very extensible as shown by extent of work needed for MIDI support.
After a bit of discussion there was another one on IRC to get the feel of what needs to be done in what way. It became apparent that the extent of work is rather large and will span months of work.
Currently darktable has: vimkeys, lua integration callbacks, key accels and dbus bindings, all of them being separate. Unification is needed in a pluggable and generic way. Suggested approach to coming up with solution was to sorta follow vimkeys approach of registering every control and then having access to it exposed for all known inputs, however multi-modules etc come a bit in way and do mess with vimkeys as of now. the job for input system would be to handle registering and unregistering of "action targets" (eg sliders, combos etc) and "input modules" (think keyboard shortcuts, midi, vimkeys etc) and handling communications between them.
From modules & control side, input system must handle:
From input modules side, input system must handle:
From iop/contributor's side input system must guarantee:
In order to create generic input system couple things must be kept in mind:
There are couple of use-cases that might be interesting to tackle with input system:
Pinging @dterrahe and @elstoc since much of their work and talk is embeded in discussions that led to above wall of text. Also pinging @houz for input
I hope I haven't missed anything :)
Wow. And I thought it sounded big _before_ you wrote it all down.
events aggregation when dt is busy/can't process and then apply once possible, cancelling of aggregated events.
BTW https://github.com/darktable-org/darktable/issues/2724 is related to what you mention here
and I'm not sure if it's a job for input system or job control. Right now it's spread over several subsystems. Similarly there's some code for smooth scrolling that aggregate events - that one is more suitable for input system. But I think input system shouldn't know about pipeline latencies and such - its job is to deliver events IMHO. Caching them inside input subsystem will only create latency. Instead job control should do these decisions.
In list 1 I forgot at the time to add "basic module replacement #3648", i.e. somehow we could imagine a user defined module, or multiple modules, that is just a collection of shortcuts to elements in other modules. Sort of like a favorite list but at the individual control level.
Event aggregation can happen at two (well, several) levels. My midi code does some aggregation, because the input event loop can already cause some midi messages to back up (if a knob is turned quickly). So I aggregate those (at least the first series of the same type) before updating the bauhaus slider. Then that slider may, I guess, send several jobs to the queue? And some of them could then become irrelevant and should get kicked out? I haven't seen a problem with that. But if it is necessary to implement something at the jobs stage and if that works really well, then the earlier stages could decide not to bother with their own aggregation.
But the main advantage of the aggregation I do in midi (and this might also go for the scroll wheel aggregation) is that if you can _see_ the queue and _know_ there is a back-log, then you can wait before kicking off the first job and aggregate what you already have. If you _don't_ see the queue, you would kick off after you've been given the first tiny move and then draw again when you're finished and see that you've accumulated a lot of changes in the mean time. _Or_ you'd have to always wait a little to see if your input module is going to send you a burst. This might work well enough, but would be slightly less responsive (depending on the delay you build in).
This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.
Most helpful comment
In list 1 I forgot at the time to add "basic module replacement #3648", i.e. somehow we could imagine a user defined module, or multiple modules, that is just a collection of shortcuts to elements in other modules. Sort of like a favorite list but at the individual control level.