WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
313 stars 46 forks source link

Added Clipboard implementation #514

Open leon-gh opened 9 months ago

leon-gh commented 9 months ago

Please consider such functionality (if not already) for r14. Feedback is welcome (NOTE: I don't consider myself a Qt developer at all, so I might have done things at wrong places).

The feature is very much useful when moving things around. I have more ideas on right-clicking the button and giving a user ability to:

But all of these could use Clipboard to get stuff done.

leon-gh commented 9 months ago

@WhiteMagic - I know r13 is frozen, I opened PR just to get feedback and if you see things changing for r14 a lot that such approach could not be used.

WhiteMagic commented 9 months ago

R14 has an entirely different profile structure which differs drastically from R13 and prior. An issue with the clipboard as implemented here is that it is not granular enough. It will copy an entire input rather than particular actions or even containers, so I wouldn't go for a solution like this.

Configurations in R14 are split differently. In R13 actions are directly linked to inputs, this changes in R14 where actions are stored in a shared library and inputs simply refer to a set of actions they use. This makes it possible to add existing actions to new inputs, which is effectively copy&paste. Something to work out is whether those assignments are treated as copies or references. It would also be possible, though not something I'm considering currently, to add copy and paste as actions or similar to individual actions. All this is significantly simpler in R14 as the information required for these operations is just an identifier rather than actual data, which is already used by the drag&drop part of the UI.

425 has some pointers to other issues around this whole idea of making it easier to duplicate and move configuration aspects.

leon-gh commented 9 months ago

@WhiteMagic - thanks for the feedback. It's good to hear that R14 will be including these kind of features, which make profile editing more efficient. This copy/paste was designed to copy a full container, rather than individual pieces - use case for this was I configured "a sophisticated" container, then realized it's in the wrong mode. I just wanted to copy it to another mode. Ended up editing xml file to move things around. I understand and see the use of actions copying too, I think R14 can understand where the CTRL+C was pressed - if object focused was a button (left pane), then it could copy a whole container, if it was an action inside or selected actions, then it would copy just that portion.

Thanks!

WhiteMagic commented 9 months ago

In the new system there no longer is the distinction between container and actions. A container is effectively just an action that has other actions as children. So copying an action will actually copy everything "associated" with it. So it could be a simple remap or a highly complicated tempo container with conditions, macros, etc.

Figuring out the UI side of things will be more challenging, as just keyboard shortcuts won't know what part the user is interested in. One option is to have a context menu or copy&paste buttons on the UI, thought that might get a bit unwieldy.