Cabbage Logo
Back to Cabbage Site

Keyboard's keydowncolour() not working?

I’ve tried setting both keydowncolour() and keysdowncolour() manually, and through identchannel. Neither seem to work. Am I missing something?

Again, tested with 20201011.2

As an aside, which is it supposed to be? Docs show keysdowncolour, but link to a non existent anchor tag of “keydowncolour”… so I tried both :wink:

1 Like

I’m pretty what’s broken is keydowncolour() :grimacing: I’ll take a look…

It’s working for me? Note that the colour of keydowncolour() is affected by mouseoverkeycolour(). keydowncolour() mixes with mouseoverkeycolour() through an alpha channel. If mouseoverkeycolour() doesn’t have an alpha channel, then keydowncolour() won’t appear to work. It’s not the most intuitive, but I just followed what JUCE does.

Maybe try the difference between clicking with a mouse vs controlling with a keyboard? I get a different result between the two, even at the same time with the same color settings!

I’m also having trouble with keywidth(), but haven’t gotten to test enough to be sure… but I just can’t get it working (at least not through an identchannel).

[quote=“t_grey, post:4, topic:2152”]
I’m also having trouble with keywidth(), but haven’t gotten to test enough to be sure… but

Touche. I see it not. Odd. I’ll take a look.

It is not currently accessible through an identchannel. FYI, each widget has a valueTreePropertyChanged() method that is called each time you pass data to its identchannel. You can see below that the keyboard widget only updates colours and layout (handleCommonUpdates() handles the layout stuff).

I can add the key width stuff. It’s not something I ever thought people would want to control in real time.

I can’t see many people would want to either… and yet here I am :rofl:

I’ve been working on this concept effect that lets you pick colors and attributes of widgets in real time to preview and then generate a “theme” config file. The more I can add, the better! But if it’s any significant work, it’s definitely not an important request by any stretch.

No significant work I think. Iain wrote a simple instrument many years ago that would let users changes the attributes of various widgets, but it sounds like you are taking it to the next level?!

Well, this “effect” is intended to generate skins for the project I’ve been working on… but a lot of it could easily apply and be incorporated into any project. It writes a config file with macros, just include the file and call any widgets called using the macros.

I don’t know that I’ve seen Iain’s example for this tho, is it included with the default build?

I think it’s called ModifyingWidgetAppearance, it should be in the Misc example.

Just pushed to GIT. Will be available in the next CI build. It sure does provide a nice way to confuse users :laughing:

1 Like

Hah, that’s awesome and cruel! I tested it here with a more “predictable” control, and it’s working great. Thanks! :partying_face:

The keydowncolour is still a little odd, but that’s ok for now and low priority. At least now that I know that it works for MIDI notes, I can watch for those if testing.

Oh, and the anchors here were what I was confused by:

Thanks, I’ll sort that, and add a note about the alpha colour thing too.