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.

I am having the same issue. mouseOverKeyColour() and keyDownColour() don’t seem to be working in the keyboard widget I set the color to be blue, but it still appears yellow when I run the code.
Am I doing something wrong or is this a bug?


Hi @mattyo. Welcome to the forum. Give me a second to test this. It should definitely have at least changed colour…

[edit] yes, this was a bug. I’ve fixed it now. You can grab the latest build from here. When the green check mark shows up on the right of the build name, click the build link. Then select the artifact link. The downloads can be a little large because they have 3 installer packages in them, but once it’s installed you should be able to set whatever colour your like for the mouse over.

1 Like

Great, thanks for the fix!

just to add something about width, i dont know if its happening in the new cabbage update but if i change the key width,let’s say to 100, i will get like 10 keys , then exit edit and then decide to change colour or other stuff , when i go back to play mode again the key width go back to original all keys

what i do for the moment is copy the keyboard width script i did and just paste it again before exit the edit.

Ok, thanks for this. So it looks like the GUI editor overwrites the keyWidth? I’ll take a look. :+1: