-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature request: Button down creates smaller image #11
Comments
Hi @TripleNico, thank you for your feedback and your idea. I really want to keep the interfaces as slim and clean as possible to directly adding a property sadly wasn't an option for me, but I like the idea to make things simpler for developers using this library. I think the solution I came up with is simple enough to help developers without compromising the simple IMacroBoard interface. Here is how it works: using var deck = StreamDeck.OpenDevice().WithButtonPressEffect();
// just use the deck as usual - if you press buttons a fake button push is shown Behind the curtain this works by wrapping the macroboard in an adapter (some sort of middle-ware) for this reason it's important that you don't interact with the original deck reference or the illusion will break. var original = StreamDeck.OpenDevice();
using var deckWithFeature = original.WithButtonPressEffect();
// do not use 'original' here or unexpected things might happen. There is also an option to configure the exact behaviour (size, offset, background color). var config = new ButtonPressEffectConfig()
{
// Try to experiment with these properties
Scale = 0.5,
OriginX = 0.5,
OriginY = 0.5,
};
using var deck = StreamDeck.OpenDevice().WithButtonPressEffect(config);
// You can even change the configuration later and it will take effect
config.Scale = 0.9; Another similar "attachable" feature that was implemented in the last version might interest you, called using var deck = StreamDeck.OpenDevice().WithDisconnectReplay(config); You can also combine multiple features if you want like so: using var deck =
StreamDeck
.OpenDevice()
.WithButtonPressEffect()
.WithDisconnectReplay(); Let me know what you think. |
@wischi-chr Thanks for your effort, this looks very promising and i like the approach you took! Currently i have no StreamDeck available so unfortunately i can't test it right now. But when i have one available i will certainly will look into this! 👍 |
If you want to check it out you can give the virtual board a try (https://github.com/OpenMacroBoard/OpenMacroBoard.SDK) - Example in the getting started section. |
First of all, my compliments about your library. It is really easy to use and well documented, keep up the good work!
If you have some time left it would be great is you can add a Property that enables "Make image smaller on button down". What do i mean? Well lets say the image is 100,100 when i push the button i would like to see that the image would be downsized to let's say 80,80 and when i release the button it returns to it's original size 100,100
This way the push action of a button is more like a software button. I noticed this behaviour if you use the stock StreamDeck software.
The text was updated successfully, but these errors were encountered: