enable and disable a button

Hello, I have the problem of disabling a key after pressing it. in practice I created two “on”, “off” buttons. When I press “on”, “off” is enabled and “on” must be disabled, and vice versa. I could not find a disbled-enabled option if it exists in processing.Can you help me. Thanks Paul

hi Paul,
could you share your code, that we can see how keys / buttons / work together.

it sounds like a toggle action, what actually would need ONE (ON / OFF ) button only
but operated from key board by 2 keys? or 2 times press same key?

if you have 2 full functional buttons but you want them to work
like a option group ( only ONE can be selected )
you need some extra code what resets the other if one is set.

You have to store this Information in new variables and act accordingly

Eg. for each button a boolean variable

you can toggle it with on1 = ! on1;

the ! means not