From 105b4be66e1188bac902e2a8394387d60e060f98 Mon Sep 17 00:00:00 2001 From: Denis Defolie Date: Fri, 30 Oct 2026 09:12:17 +0100 Subject: [PATCH] Make the annotation and click-preview hotkeys switch on what they need Ctrl+Alt+Shift+A did nothing while the master switch was off, and Ctrl+Alt+Shift+Y did nothing unless the master switch and the click effects were both on, with no feedback. They now enable what is missing (and persist it, like the other toggles) before acting. Document the Y hotkey in both READMEs. Co-Authored-By: Claude Sonnet 5.5 --- README.fr.md | 3 +++ README.md | 3 +++ src/core.rs | 19 +++++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.fr.md b/README.fr.md index 2e8ef21..9a81d60 100644 --- a/README.fr.md +++ b/README.fr.md @@ -78,6 +78,9 @@ Prérequis à l'exécution : | `Ctrl+Alt+Shift+F` | Mode focus | | `Ctrl+Alt+Shift+A` | Mode annotation | | `Ctrl+Alt+Shift+X` | Effacer les annotations | +| `Ctrl+Alt+Shift+Y` | Montrer l'effet de clic à l'emplacement du pointeur | + +Le mode annotation et l'aperçu du clic activent ce dont ils ont besoin (l'interrupteur général, et les effets de clic pour l'aperçu) lorsque c'est éteint. **Dessiner.** Maintenez la touche `Ctrl` de droite et bougez le pointeur : un trait suit, puis s'efface après le relâchement. Pour plus de contrôle, ouvrez le **mode annotation** : une barre d'outils apparaît et la surcouche capture la souris et le clavier. diff --git a/README.md b/README.md index 680a385..74a18d6 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ Run-time requirements: | `Ctrl+Alt+Shift+F` | Focus mode | | `Ctrl+Alt+Shift+A` | Annotation mode | | `Ctrl+Alt+Shift+X` | Clear annotations | +| `Ctrl+Alt+Shift+Y` | Show the click effect at the pointer | + +Annotation mode and the click preview switch on what they need (the master switch, and the click effects for the preview) when it is off. **Drawing.** Hold the right `Ctrl` key and move the pointer: a stroke follows and fades away after you release. For more control open the **annotation mode**: a toolbar appears and the overlay captures the mouse and keyboard. diff --git a/src/core.rs b/src/core.rs index a5b9daa..cb5c794 100644 --- a/src/core.rs +++ b/src/core.rs @@ -151,8 +151,23 @@ impl Core { } Err(e) => log::warn!("set {k}: {e}"), }, - Command::ShowClick => self.engine.show_click(now), - Command::AnnotateToggle => self.engine.toggle_annotation_mode(), + Command::ShowClick => { + // Asking for a preview of the click effect must not silently do nothing: switch on what it needs. + if !self.cfg.general.enabled || !self.cfg.clicks.enabled { + self.cfg.general.enabled = true; + self.cfg.clicks.enabled = true; + self.commit(); + } + self.engine.show_click(now); + } + Command::AnnotateToggle => { + // Annotation mode only starts while the master switch is on; leaving it needs nothing. + if !self.cfg.general.enabled { + self.cfg.general.enabled = true; + self.commit(); + } + self.engine.toggle_annotation_mode(); + } Command::AnnotateClear => self.engine.clear_annotations(), Command::Reload => self.reload(), Command::Status(tx) => {