From: Carl Worth Date: Sun, 8 Mar 2026 15:42:23 +0000 (-0400) Subject: anagrams: Allow pressing Enter to start a claim X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b808a2820da3a2c1f5cba7cf23212e35a38cb33b;p=lmno.games anagrams: Allow pressing Enter to start a claim If claiming letters from the center, the user can just start typing. But for a steal, they need another keybinding to initiate the claim phase and Enter seems like a reasonable option for this. --- diff --git a/anagrams/anagrams.jsx b/anagrams/anagrams.jsx index 3ad6970..09e5f04 100644 --- a/anagrams/anagrams.jsx +++ b/anagrams/anagrams.jsx @@ -601,11 +601,15 @@ class Game extends React.Component { return; } - /* Enter: submit word during claim. */ - if (key === "ENTER" && this.state.claim_active) { + /* Enter: submit word during claim, or start a claim. */ + if (key === "ENTER") { e.preventDefault(); - if (this.state.claim_rack.length >= 4) { - this.submit_word(); + if (this.state.claim_active) { + if (this.state.claim_rack.length >= 4) { + this.submit_word(); + } + } else if (!this.state.claiming && !this.state.claim_player) { + this.start_claim(); } return; }