Under "Preference / Game behaviour / Castling method" the two options "Move king two squares" and "Move king onto rook" exist.
As I understand the second allows castling by moving the king two squares, so as the first option, but also by moving the king onto the rook. Where does this need come from to castle by moving the king onto the rook?
This feature creates a problematic use case, which happened to me: When castling is possible, e.g. kingside and then clicking the king. Now when I click rook on the kingside, the castling move is performed, bam. When I want to move the rook, I need first to unclick the king. This behaviour is unexpected. For otherwise when clicking one piece, then clicking another piece, always the move with the second piece is performed. Only here not. Click king, click rook, bum; the system makes the castling move, no way to get back.
So as explained, this behaviour is not intuitive and can cause problems as illustrated. I suggest the two following points:
Make "Move king two squares" the default. Only allow castling by dragging the king onto the rook, not by clicking the king and then clicking the rook with this option.
Clicking king, clicking rook, bam, castles as default and costed me 15 rating points. Can you please check this?
I had never noticed that.
But you are right, it is annoying if you click on the King and then changing your mind you want to move the Rook.
However, a default preference is supposed to suit the majority and may this is the case.
The good news is that you can disable it on lichess.org (I checked on chess.com, the behaviour you are grudging is the default behaviour ... no option to disable it).
So, it is likely that this issue will be closed with: If you don't like the behaviour, disable it :)
I saw there is also an option to confirm your moves to avoid misclicks in lichess.org
No! On chess.com clicking the king then clicking the rock moves the rook. Not as on Lichess, which causes castling, which is the problem I reported. Sliding the king onto the rook is fine for castling, but not clicking the king, then clicking the rook. Nobody castles this way. It is a usability bug!!!
Please look at this again, don't close in the second opening it.
Strange, for me it works exactly the same way ...
https://www.chess.com/explorer?moveList=e4+e5+Nf3+Nc6+Bc4+Bc5&ply=6
Click on the white king and then on the white rook > it castles (for me at least ...)
What I find strange both on chess.com and lichess.org is that whatever preference (drag or clik), I can either drag the pieces or move them clicking on a valid square.
I checked real games on chess.com, there clicking the king, then the rook did not castle. On the Analysis Board in chess.com it is as on Lichess.
@dlbbld Would you suggest special casing Chess960?
I clicked the king, evaluated kingside castling, decided not to for weak kingside. Then clicked the kingside rook for defence move and that caused the castling. That cost me the rated game. Such castling behaviour can only be unintentional - nobody castles by clicking the king, then the rook.
@niklasf I'm not sure I understand your question
Sorry, I wanted to ask @dlbbld. But anyway ... In Chess960 castling by moving the king two squares makes no sense or is not even possible (e.g., king on the b file castling a-side). So currently the only way to castle in Chess960 is by moving the king onto the rook. If the player prefers to move by two clicks instead of dragging, the only way is to click the king, then the rook. So disallowing that in general would break two-click input for Chess960.
Edit: Example position: https://lichess.org/analysis/rk1r4/pppppppp/8/8/8/8/PPPPPPPP/RK6_w_Qkq_-_0_1
@niklasf I believe castling by moving the king onto the rook by clicking the king and then the rook is wanted in standard too because a lot of people using their touchscreens prefer the two click king onto rook method over dragging the king.
At least in standard chess you could argue that players could click the king, then click the c or g file instead of the rook. But that's not possible in 960, so the proposed change would require a special case there.
More importantly, it would break habits of users that prefer to input castling as @ijhchess described.
@niklasf Sorry I am not a Chess960 player. So I want to pass the question to a Chess960 player instead.
@ijhchess It would be much easier to require the proper castling move from the user; instead of providing an option which has nothing to do with OTB. In all games before I played when I click piece A then piece B, I could move piece B. It is normal to assume this as a rule. With the only exception of castling by king click then rook click. I think it's not good to have such an exception. I would never have come to the idea that this causes castling. There was no way I could foresee and prevent this accidental castling.
Ok, fair. But it should be clear now that it's not just a straight forward usability improvement with no downsides.
The issue is also mitigated by the highlighting (which is on by default):

@niklasf I have seen that highlighting but honestly did not understand that this has anything to do with castling. That looked only scary to me. And in a game, I have no time to think about such observations.
I know it will not happen, but castling is such an easy rule: Moving the king two square in one direction and moving the rook one square next to the king in the opposite direction. So there is also a justification in requiring the user to learn this move instead of having to build complicated features around it, like moving the king onto the rook. As an idea only, the learning could be supported by showing king and rook movement. In over a thousand games, not once I came to the idea that castling by moving the king onto the rook would be helpful.
With hindsight, I would not be surprised if this behaviour had been introduced for chess960.
With classic chess you always have at least 2 squares between the King and the Rook, so you don't need it.
I am puzzled by the 'Castling method' preference, it does not seem to do much
(Actually the option works fine)
@niklasf Yes, in Chess960 castling this way by clicking king, then rook, can be forced. To put standard chess and Chess960 under the same roof as such is challenging. To think outside the box, it would be possible having one button for kingside castling and/or queenside castling if available. And of course as a bummer, the "I'm Feeling Lucky" button for random side castling.
This sounds crazy at first and second thought and is just for the idea. But castling by dragging king onto rock is a beginner's feature in my point of view. Having such buttons for beginners would be more intuitive. Just brainstorming.

@dlbbld I am not too sure where the problem is now ...
Why don't you check Preferences > Game Behaviour > Castling Method > Move king two square ?
Very sharp, right, thanks for reminding where it started. ~Just the default~ (revising, see below), I'd like "Castle by moving by two squares" as the default, not "Castle by moving onto the rook".
val choices = Seq(
NO -> "Castle by moving by two squares",
YES -> "Castle by moving onto the rook"
)
rookCastle = RookCastle.YES,
With hindsight, I would not be surprised if this behaviour had been introduced for chess960.
It looks exactly in this direction. For chess960 the user preference makes no sense, as in many cases it must be ignored, otherwise castling would be impossible with preference "Move king two squares". I checked, it is actually ignored.
So another approach is to remove the user preference. For chess960 allow castling by moving king onto rook, as sometimes necessary, for standard chess not. Way to go?
@dlbbld I also tried with https://lichess.org/study/vEKdglsp (position 2) and I came to the same conclusion as you that whatever your preference is, you will still be able to castle bringing the king on the rook.
So technically, there should not be any problem changing the default castling to 'Move king two squares'.
I agree with you and I have changed my preference since I read your first comment on this issue (and, as I said in a previous comment, I wish I could also do it on chess.com)
However, as a maintainer (which I am not on this project), I know for sure that changing a default behaviour can sometimes create surprising mass reactions.
So the big questions for this seemingly very easy change are:
@niklasf @ijhchess Can you find out how many players have changed their preference ?
The castling move is now indicating as moving onto any other opponent figure. I find it a good idea to distinguish the castling move from the other moves visually. Adding a red dot already would be a clear visual indication. What about moving in this direction?

The castling is a king move by the rules; this is why in standard chess, for me, the castling must be a king move. And not the king moving onto the rook. For Chess960 things are different. I however also understand that when users are used to something, you cannot just take it away (like castling by moving king onto the rock in standard chess). This topic shows to me that if one gives the user too many options, one has to live with the problems that arise.
It is not enough for a change if only two users complain about a setting which impacts possibly many users, that would be too big for one's boots. More users should complain. Also, as an impact analysis was not possible, I assume timewise, the issue for me can be closed鈥攏o reason to keep it open.
What other reason would you want to move the king onto the rook for though? You can't move the Rook onto the King for any other reason. I'd say if you want to move a different peice, just click on another part if the screen (That won't cause anything to happen, for example the game clock) and then make your move.
The root problem is that when the king is clicked first for castling, but then the user wants to move the rook involved in castling instead, the user first must "unclick" the king, and only then can move the rook. When not doing so, the system castles.
For example:
That is contrary to the system behaviour for all other cases:
So the king must be "unclicked" for this action:
This behaviour is unexpected, for the expected behaviour is the system behaviour for the other 99% cases, when clicking one piece, and then deciding to move another piece. It cost me one game for castling accidentally kingside when the kingside was already too exposed.
For the special rules in chess960, moving the king onto the rook for castling is a required feature.
That causes now a problem in standard chess. To resolve is not easy. Some users might be used to castle by moving the king onto the rook in standard chess by now. To remove this feature for standard chess might confuse them. I personally don't care about this, for the users don't need a feature which makes no sense per my opinion. But there are other opinions. One could also implement a transition phase: If the user tries to castle in this way in standard chess tell him or her in the GUI that the feature was decommissioned :-) I know I will not make friends with this.
However on a technical level to remove the feature that moving the king onto the rook in standard chess castles for standard chess, would solve the problem.
My final opinion is that in standard chess castling should be by moving the king two squares, in chess960 the same if standard position, otherwise by moving king onto rook. This approach eliminates the need to have a user setting and as such, is a clear and straightforward solution.
For not getting this a stale issue I think it would be good to find a consensus for a solution. Then finally still the programmers will decide if they do it or not. Or on the other side to drop and live with this what I consider a usability bug. As for now, the issue is not very helpful, some ideas discussed, but no concrete approach, not so helpful for the programmers.
Closing as there is no further work on it, no reason to wait until the issue gets stale.
Most helpful comment
Sorry, I wanted to ask @dlbbld. But anyway ... In Chess960 castling by moving the king two squares makes no sense or is not even possible (e.g., king on the b file castling a-side). So currently the only way to castle in Chess960 is by moving the king onto the rook. If the player prefers to move by two clicks instead of dragging, the only way is to click the king, then the rook. So disallowing that in general would break two-click input for Chess960.
Edit: Example position: https://lichess.org/analysis/rk1r4/pppppppp/8/8/8/8/PPPPPPPP/RK6_w_Qkq_-_0_1