So I have “red” and “green” function keys.
Each other key has four characters associated with it: white, red, green, blue
This is the behavior I want:
If Red is pressed once, and no other function keys are pressed, next keypress is the red character, everything else is the white character.
If Red is pressed twice, and no other function keys are pressed, everything after that is the red character. Then if the Red key is pressed again, everything else is the white character.
If Green is pressed once, and no other function keys are pressed, next keypress is the green character, everything else is the white character.
If Green is pressed twice, and no other function keys are pressed, everything after that is the green character. Then if the Green key is pressed again, everything else is the white character.
If either function key is pressed once, and then the other is pressed once, and no other function keys are pressed, the next character is the blue one, and everything after that is the white character.
If a function key is pressed twice in a row, and then optionally some characters are typed, and then the other function key is pressed once, and no other function keys are pressed, all characters after that are the blue ones. Then if any function key is pressed, everything after that is the white character.
Is there a simple way of doing this or something like this? I keep getting in weird states where neither function key works.