Same-Key Show and Rate - Double-Duty Hotkey 1

AnkiWeb addon 290816457

Enables configured keyboard shortcuts to reveal answers and rate cards on the same keypress, eliminating spacebar use during Anki Desktop reviews.
AI-generated summary; may contain mistakes.

review-flowshortcuts

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2026-06-16
Anki versions
25.09.4~
Description language
en

Maintenance

active

  • Last update or commit was 107 days before the snapshot (2026-06-16).
  • The repository has 1 test files.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
24.06.325.09.4+2026-06-16
History across monthly snapshots

Loading…

Similar addons

Hint Hotkeys

Adds customizable reviewer hotkeys to reveal hints individually or all at once, with defaults H and Shift+H.

review-flowshortcuts

Rating 50 πŸ‘ 44 Β· πŸ‘Ž 6 ⭐ 7 Anki 2.1.62~ Updated 2023-04-14
ReQueue

Undoes an accidental card reveal, temporarily buries and reshuffles it into the deck without penalty, with customizable cooldown, shortcut, and duplicate protection.

review-flowshortcuts

Rating 0 πŸ‘ 0 Β· πŸ‘Ž 0 ⭐ 2 Anki 2.1.1~ Updated 2025-11-27
Controller4Anki

Control Anki reviews with any gamepad: map buttons to 28 actions, open live config, and rate, reveal, undo, and more without keyboard or mouse.

review-flowshortcutsaccessibility

Rating 0 πŸ‘ 0 Β· πŸ‘Ž 0 Anki 2.1.1~ Updated 2026-05-19
Mouse Shortcuts

Assigns mouse buttons and scroll actions to answer, grade, or undo cards during Anki reviews, with separate question/answer mappings, long-press options, and quick toggling.

review-flowshortcutsaccessibility

Rating 1 πŸ‘ 1 Β· πŸ‘Ž 0 ⭐ 0 Anki 25.07.1~ Updated 2026-08-02

README

Anki Same-Key Show and Rate

Version License: MIT AnkiWeb

An Anki Desktop add-on that enables keyboard shortcuts (default 1, 2, 3, 4, h) to perform same-key show and rate operations during review, eliminating the need to hit the spacebar on every card.

Table of Contents


Features

  • Spacebar-Free Reviewing: Pressing any configured answer shortcut when a card's question (Front) is active will instantly show the answer.
  • Same-Key Rating: Pressing the shortcut key again when the card's answer (Back) is active will rate the card using that key's assigned rating/action.
  • Custom Shortcuts Compatibility: Works with default numeric keys (1 to 4) as well as custom keybindings (like Vim mappings or other layouts).

Return to Top

How It Works

The add-on automates the review loop using the following state transitions:

  1. Card Question (Front Side / Unrevealed):
    • When a new card is presented, Anki is in the "question" state.
    • Pressing any of your configured trigger keys (e.g., 3 or j) intercepts the keypress and triggers the Show Answer (flip) action (showAnswer()), revealing the back side of the card.
  2. Card Answer (Back Side / Revealed):
    • Once the answer is shown, Anki enters the "answer" state.
    • Pressing the same key (e.g., 3 or j) routes to the mapped target action:
      • If the target has an existing shortcut registered in Anki, it triggers that shortcut's action (e.g., running the custom handler for rating 3/Good).
      • If there is no handler, it falls back to directly answering/rating the card (answerCard(ease)) using the configured rating index.
    • Rating the card automatically loads the next card's question, restarting the loop at Step 1.

Return to Top

Project Structure

This project is organized following modular Python development best practices for Anki add-ons:

20260615234828-anki-same-key-show-and-rate/
β”œβ”€β”€ .gitattributes
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE                                # Project license
β”œβ”€β”€ README.md                              # Documentation
β”œβ”€β”€ release-notes.md                       # Version release notes
β”œβ”€β”€ pytest.ini                             # Pytest configuration
β”œβ”€β”€ manifest.json                          # Anki addon manifest (required at root)
β”œβ”€β”€ config.json                            # Addon configuration defaults (required at root)
β”œβ”€β”€ config.json.template                   # Addon configuration template (required at root)
β”œβ”€β”€ meta.json                              # Local addon state metadata (required at root)
β”œβ”€β”€ __init__.py                            # Entry point, imports src.main
β”œβ”€β”€ scripts/                               # Developer build and deployment tools
β”‚   β”œβ”€β”€ make_release.py                    # Release compilation entry point
β”‚   β”œβ”€β”€ make_deploy.py                     # Local addon deployment utility
β”‚   └── packaging/                         # Subdirectory containing internal build pipelines
β”‚       β”œβ”€β”€ packaging.ini                  # Release configurations and exclusions
β”‚       β”œβ”€β”€ release_pipeline.py            # Orchestrator
β”‚       β”œβ”€β”€ create_addon_zip.py            # Zips addon and writes checksums
β”‚       β”œβ”€β”€ setup_local_vendor.py          # Prepares local wheels
β”‚       └── build_all_vendors.py           # Prepares platform wheels
β”œβ”€β”€ src/                                   # All codebase logic
β”‚   β”œβ”€β”€ __init__.py                        # Package initialization (empty file)
β”‚   └── main.py                            # Core same-key show/rate hook logic
└── tests/                                 # Test suite
    └── test_main.py                       # Tests for the core logic in main.py

Return to Top

Compatibility

  • Supported on Anki Desktop 24.x and 25.x.
  • Compatible with Windows, macOS, and Linux.
  • Note: Python add-ons do not run on AnkiDroid or AnkiMobile.

Return to Top

Installation

  1. Close Anki completely.
  2. Copy this directory into your local Anki add-ons folder (typically AppData\Roaming\Anki2\addons21\20260615234828-anki-same-key-show-and-rate).
  3. Restart Anki.

Return to Top

Configuration

You can customize the list of active same-key mappings via Anki's Add-on config manager (Tools > Add-ons > Same-Key Show and Rate > Config).

Default configuration:

{
    "hotkeys": {
        "1": "1",
        "2": "2",
        "3": "3",
        "4": "4",
        "h": "h"
    }
}

The keys of the hotkeys object are the triggers on the keyboard. The values represent the target shortcut/action key to run on the back side of the card (e.g., "h" maps to "h"'s default back action, while "1" maps to "1"'s default back action).

Why Key-Value Mappings instead of a Simple List?

If the configuration used a simple list of keys (e.g., ["1", "2", "3", "4", "h"]), it would assume that the key pressed on the front must trigger itself on the back. While this works for standard keys, it breaks down for more advanced layouts:

  1. Custom Key Routing: If a user reviews using a custom layout (e.g., mapping h to Again, j to Good, and e to Easy in Anki's settings), they can configure {"h": "1", "j": "3", "e": "4"}. Tap h to flip the card, and tap it again to route directly to rating 1 (Again).
  2. Decoupling Triggers from Actions: A dictionary decoupling allows any physical key on the keyboard to map to any logical rating or handler on the back side of the card, regardless of whether that key natively performs a rating in Anki.
  3. Robust Fallbacks: If a target key does not have an original handler registered, the mapping tells the add-on which ease rating to fallback to (e.g., routing h to rate 1).

Return to Top

Testing

The project includes a pytest suite for offline testing of shortcut registrations, state detection, and configurations.

Running Tests

Execute pytest from the project root:

pytest

Return to Top

License

This project is licensed under the MIT License.

See the LICENSE file details (or standard MIT terms).

Return to Top