Is it possible to create arrows of different colors with different cmouse and keyboard keys events?
https://github.com/user-attachments/assets/9670d40f-9269-403e-ac89-32c1667ddd02
Is it possible to create arrows with different colors taking into account the click on the mouse key and some keys in the keyboard like Shift and Alt? This is in order to replicate this behaviour that you see at the video that was taken from lichess. In advance thanks
Shift + Left click = Green arrow Shift + Right click = Red arrow Shift + Alt + Left click = Blue arrow Shift + Alt + Right click = Yellow arrow
Hmm wouldn't just having a listener to set the color of the customArrowColor prop based on the key presses work?
But how can I keep the different arrow colors, because I can set there only one color, so if I change that variable, all the arrows are going to change their color, not in an individual way
Hmm good point. I'm only brainstorming but couldn't you then set the customArrows prop to do that then? A listener to set the color based on keys pressed. From is just set onSquareRightClick and to set onMouseOverSquare with a possible cleanup onMouseOutSquare. Again, just brainstorming and I haven't tested it. But seems feasible. If that doesn't work then it's probably a good feature requst as I can see people using that :)
I am not sure about the shortcuts etc, but it's possible. We use colours at the bottom of the board
We are also providing the property customArrows for that use case.
closing due to no activity