Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

打字通 - DaZiTong

一款现代化的打字练习软件 | A Modern Typing Practice Software

C++23 Qt6 Linux Version License


📖 目录 | Table of Contents


中文文档

简介

打字通(DaZiTong) 是一款基于 Qt6 和 C++23 开发的现代化打字练习软件,专为提升打字速度和准确率而设计。软件支持中英文混合输入,提供实时的打字统计数据,并内置历史记录功能。

无论是初学者还是专业打字员,都可以通过打字通进行系统化的打字训练,逐步提升打字技能。

功能特性

🎯 核心功能

  • 对照输入模式:原文与输入内容交叉显示,便于对比
  • 实时统计:实时显示 WPM(每分钟字数)、CPM(每分钟字符数)、准确率和用时
  • 多语言支持:完美支持中文、英文及中英文混合输入
  • 输入法兼容:全面支持系统输入法(拼音、五笔等)
  • 自动换行:智能单词级换行,避免单词被拆分

🎨 界面特性

  • 光标闪烁:可配置的光标闪烁动画(500ms 间隔)
  • 状态高亮
    • 🔵 蓝色:当前位置(待输入)
    • 绿色:已正确输入
    • 🔴 红色:输入错误
    • ⚪ 灰色:未输入
  • 通栏横线:清晰的行组分隔,提升视觉体验
  • 换行符可视化:显示 ↵ 符号提示换行位置

💾 数据管理

  • SQLite 数据库:自动保存练习历史记录
  • 历史记录:查看过往练习成绩,追踪进步轨迹
  • 字体自定义:支持字体家族和大小的个性化设置

⌨️ 交互体验

  • 键盘快捷键
    • Ctrl+O:打开文本文件
    • Ctrl+Q:退出程序
    • F5:刷新/重置练习
  • 菜单与工具栏:完整的文件、视图、练习菜单
  • 状态栏提示:实时显示操作反馈

系统要求

  • 操作系统:Linux(推荐 Ubuntu 20.04+ / Fedora 33+)
  • 编译器:GCC 12+ 或 Clang 14+(支持 C++23)
  • GUI 框架:Qt 6.5+
  • 数据库:SQLite3
  • CMake:3.20+

依赖安装(Ubuntu/Debian)

sudo apt update
sudo apt install -y \
  build-essential \
  cmake \
  qt6-base-dev \
  libsqlite3-dev

依赖安装(Fedora/RHEL)

sudo dnf install -y \
  gcc-c++ \
  cmake \
  qt6-qtbase-devel \
  sqlite-devel

快速开始

1. 克隆仓库

git clone https://github.com/weboot/dzt.git
cd dazhitong

2. 编译项目

# 创建构建目录
mkdir build && cd build

# 配置项目
cmake .. -DCMAKE_BUILD_TYPE=Release

# 编译
make -j$(nproc)

3. 运行程序

# 方式 1: 直接运行
./DaZiTong

# 方式 2: 使用脚本
cd ..
./run.sh

4. 一键编译运行

./build.sh  # 自动编译并运行

使用说明

基本操作

  1. 加载文本

    • 菜单栏:文件打开文件
    • 快捷键:Ctrl+O
    • 支持 .txt 格式,自动检测 UTF-8 编码
  2. 开始练习

    • 点击工具栏的 开始 按钮
    • 或直接开始输入,自动计时
  3. 暂停/继续

    • 工具栏:暂停 / 继续
    • 暂停期间计时停止
  4. 重置练习

    • 工具栏:重置 按钮
    • 快捷键:F5
    • 清空所有进度,重新开始
  5. 查看历史

    • 菜单栏:视图历史记录
    • 查看所有练习记录和统计数据
  6. 调整字体

    • 菜单栏:视图字体设置
    • 选择喜欢的字体和大小

输入技巧

  • 退格键Backspace 删除错误字符
  • 换行符:按 Enter 输入换行(显示为 ↵)
  • 中文输入:切换到系统输入法(如 IBus、Fcitx)
  • 单词保护:英文单词不会被拆分到两行

统计指标

指标 说明 计算公式
WPM 每分钟字数(Words Per Minute) (正确字符数 / 5) / 时间(分钟)
CPM 每分钟字符数(Characters Per Minute) 总字符数 / 时间(分钟)
准确率 输入正确率 (正确字符数 / 总字符数) × 100%
用时 练习耗时 从第一次输入到完成的时间

技术栈

  • 语言:C++23
  • GUI 框架:Qt 6(Widgets 模块)
  • 构建系统:CMake 3.20+
  • 数据库:SQLite3
  • 文本处理:QString(Unicode)+ std::string(UTF-8)
  • 输入法支持:Qt InputMethod 框架

项目结构

dazhitong/
├── src/                    # 源代码目录
│   ├── main.cpp           # 程序入口
│   ├── app/               # 应用层
│   │   ├── Application.cpp/h    # 应用主类
│   │   └── Config.cpp/h         # 配置管理
│   ├── ui/                # UI 组件
│   │   ├── MainWindow.cpp/h     # 主窗口
│   │   ├── TypingWidget.cpp/h   # 打字练习组件(核心)
│   │   ├── StatsWidget.cpp/h    # 统计面板
│   │   └── HistoryDialog.cpp/h  # 历史记录对话框
│   ├── core/              # 核心逻辑
│   │   ├── TypingEngine.cpp/h   # 打字引擎
│   │   ├── HighPrecisionTimer.cpp/h  # 高精度计时器
│   │   ├── Statistics.cpp/h     # 统计计算
│   │   ├── TextLoader.cpp/h     # 文本加载器
│   │   └── DatabaseManager.cpp/h    # 数据库管理
│   └── models/            # 数据模型
│       ├── PracticeRecord.cpp/h   # 练习记录
│       └── Settings.cpp/h         # 设置模型
├── resources/             # 资源文件
│   └── samples/           # 示例文本
├── tests/                 # 测试用例(待添加)
├── CMakeLists.txt         # CMake 构建配置
├── build.sh               # 一键编译脚本
── run.sh                 # 一键运行脚本

贡献指南

欢迎贡献代码、报告问题或提出建议!

贡献流程

  1. Fork 本仓库
  2. 创建特性分支git checkout -b feature/AmazingFeature
  3. 提交更改git commit -m 'Add some AmazingFeature'
  4. 推送分支git push origin feature/AmazingFeature
  5. 提交 Pull Request

代码规范

  • 遵循 C++ Core Guidelines
  • 使用 clang-format 格式化代码
  • 添加必要的注释(中文或英文)
  • 确保通过编译和无内存泄漏

报告问题

使用 GitHub Issues 报告 bug 或请求新功能,请包含:

  • 问题描述
  • 复现步骤
  • 预期行为
  • 实际行为
  • 系统环境(OS、Qt 版本、编译器版本)

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件。

联系方式


English Documentation

Introduction

DaZiTong is a modern typing practice software built with Qt6 and C++23, designed to improve typing speed and accuracy. It supports mixed Chinese and English input, provides real-time typing statistics, and includes a built-in history tracking feature.

Whether you're a beginner or a professional typist, DaZiTong offers systematic typing training to help you gradually enhance your typing skills.

Features

🎯 Core Features

  • Comparison Input Mode: Original text and input are displayed interleaved for easy comparison
  • Real-time Statistics: Live display of WPM, CPM, accuracy, and elapsed time
  • Multi-language Support: Perfect support for Chinese, English, and mixed input
  • Input Method Compatible: Full support for system input methods (Pinyin, Wubi, etc.)
  • Smart Word Wrapping: Word-level line breaks to prevent word splitting

🎨 UI Features

  • Cursor Blinking: Configurable cursor blink animation (500ms interval)
  • Status Highlighting:
    • 🔵 Blue: Current position (pending input)
    • 🟢 Green: Correctly typed
    • 🔴 Red: Typing error
    • ⚪ Gray: Not yet typed
  • Horizontal Separators: Clear visual separation between line groups
  • Newline Visualization: Shows ↵ symbol to indicate line breaks

💾 Data Management

  • SQLite Database: Automatic saving of practice history
  • History Records: View past performance and track progress
  • Font Customization: Personalized font family and size settings

️ User Experience

  • Keyboard Shortcuts:
    • Ctrl+O: Open text file
    • Ctrl+Q: Quit application
    • F5: Refresh/Reset practice
  • Menus & Toolbar: Complete File, View, and Practice menus
  • Status Bar Feedback: Real-time operation notifications

System Requirements

  • Operating System: Linux (Ubuntu 20.04+ / Fedora 33+ recommended)
  • Compiler: GCC 12+ or Clang 14+ (C++23 support)
  • GUI Framework: Qt 6.5+
  • Database: SQLite3
  • CMake: 3.20+

Install Dependencies (Ubuntu/Debian)

sudo apt update
sudo apt install -y \
  build-essential \
  cmake \
  qt6-base-dev \
  libsqlite3-dev

Install Dependencies (Fedora/RHEL)

sudo dnf install -y \
  gcc-c++ \
  cmake \
  qt6-qtbase-devel \
  sqlite-devel

Quick Start

1. Clone Repository

git clone https://github.com/yourusername/dazhitong.git
cd dazhitong

2. Build Project

# Create build directory
mkdir build && cd build

# Configure project
cmake .. -DCMAKE_BUILD_TYPE=Release

# Build
make -j$(nproc)

3. Run Application

# Method 1: Direct execution
./DaZiTong

# Method 2: Using script
cd ..
./run.sh

4. One-Command Build & Run

./build.sh  # Automatically builds and runs

Usage Guide

Basic Operations

  1. Load Text

    • Menu: FileOpen File
    • Shortcut: Ctrl+O
    • Supports .txt format with automatic UTF-8 detection
  2. Start Practice

    • Click the Start button on the toolbar
    • Or start typing directly (auto-timing)
  3. Pause/Resume

    • Toolbar: Pause / Resume
    • Timer stops during pause
  4. Reset Practice

    • Toolbar: Reset button
    • Shortcut: F5
    • Clears all progress and restarts
  5. View History

    • Menu: ViewHistory
    • View all practice records and statistics
  6. Adjust Font

    • Menu: ViewFont Settings
    • Choose your preferred font and size

Typing Tips

  • Backspace: Backspace key to delete incorrect characters
  • Newlines: Press Enter to input line breaks (displayed as ↵)
  • Chinese Input: Switch to system input method (IBus, Fcitx, etc.)
  • Word Protection: English words won't be split across lines

Statistics Metrics

Metric Description Formula
WPM Words Per Minute (Correct Characters / 5) / Time(minutes)
CPM Characters Per Minute Total Characters / Time(minutes)
Accuracy Typing accuracy rate (Correct / Total) × 100%
Time Practice duration Time from first input to completion

Technology Stack

  • Language: C++23
  • GUI Framework: Qt 6 (Widgets module)
  • Build System: CMake 3.20+
  • Database: SQLite3
  • Text Processing: QString (Unicode) + std::string (UTF-8)
  • Input Method Support: Qt InputMethod framework

Project Structure

dazhitong/
├── src/                    # Source code directory
│   ├── main.cpp           # Application entry point
│   ├── app/               # Application layer
│   │   ├── Application.cpp/h    # Main application class
│   │   └── Config.cpp/h         # Configuration management
│   ├── ui/                # UI components
│   │   ├── MainWindow.cpp/h     # Main window
│   │   ├── TypingWidget.cpp/h   # Typing practice widget (core)
│   │   ├── StatsWidget.cpp/h    # Statistics panel
│   │   └── HistoryDialog.cpp/h  # History records dialog
│   ├── core/              # Core logic
│   │   ├── TypingEngine.cpp/h   # Typing engine
│   │   ├── HighPrecisionTimer.cpp/h  # High-precision timer
│   │   ├── Statistics.cpp/h     # Statistics calculation
│   │   ├── TextLoader.cpp/h     # Text loader
│   │   ── DatabaseManager.cpp/h    # Database manager
│   └── models/            # Data models
│       ├── PracticeRecord.cpp/h   # Practice record
│       └── Settings.cpp/h         # Settings model
├── resources/             # Resource files
│   └── samples/           # Sample texts
├── tests/                 # Test cases (to be added)
├── CMakeLists.txt         # CMake build configuration
├── build.sh               # One-click build script
└── run.sh                 # One-click run script

Contributing

Contributions are welcome! Whether it's code, bug reports, or feature suggestions.

Contribution Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add some AmazingFeature'
  4. Push to branch: git push origin feature/AmazingFeature
  5. Open a Pull Request

Code Standards

  • Follow C++ Core Guidelines
  • Format code using clang-format
  • Add necessary comments (Chinese or English)
  • Ensure compilation succeeds and no memory leaks

Reporting Issues

Use GitHub Issues to report bugs or request features. Please include:

  • Problem description
  • Steps to reproduce
  • Expected behavior
  • Actual behavior
  • System environment (OS, Qt version, compiler version)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact


致谢 | Acknowledgments

感谢所有为这个项目做出贡献的开发者!

Thanks to all the developers who have contributed to this project!


Made with ❤️ using C++ & Qt

About

打字通(DaZiTong) 是一款基于 Qt6 和 C++23 开发的现代化打字练习软件,专为提升打字速度和准确率而设计。软件支持中英文混合输入,提供实时的打字统计数据,并内置历史记录功能。 无论是初学者还是专业打字员,都可以通过打字通进行系统化的打字训练,逐步提升打字技能。

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages