Scripts2026年5月21日·1 分钟阅读

Karabiner-Elements — Powerful Keyboard Customizer for macOS

A free utility for macOS that lets you remap keys, create complex modification rules, and customize any keyboard at the system level.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Karabiner-Elements Overview
通用 CLI 安装命令
npx tokrepo install d638e629-550f-11f1-9bc6-00163e2b0d79

Introduction

Karabiner-Elements is a system-level keyboard customizer for macOS that intercepts key events before they reach applications. It allows simple remapping as well as complex multi-key rules, making it a foundational tool for developers and power users who rely on custom keyboard workflows.

What Karabiner-Elements Does

  • Remaps any key to any other key at the OS level
  • Supports complex rules with conditions like app-specific bindings
  • Handles simultaneous key presses and key sequences (chording)
  • Works with any USB, Bluetooth, or built-in keyboard
  • Provides per-device configurations for different keyboards

Architecture Overview

Karabiner-Elements consists of a kernel-level virtual keyboard driver and a user-space event processing daemon. The driver creates a virtual HID device that replaces the original keyboard input. The daemon reads events from the physical keyboard, applies modification rules defined in JSON, and writes the transformed events to the virtual device. A preferences app provides a GUI for managing rules.

Self-Hosting & Configuration

  • Install via Homebrew: brew install --cask karabiner-elements or download the DMG
  • Requires macOS 11 Big Sur or later
  • Grant Input Monitoring and kernel extension permissions when prompted
  • Edit rules via the GUI or directly in ~/.config/karabiner/karabiner.json
  • Import community rules from the online rule gallery with one click

Key Features

  • Simple one-to-one key remapping with no configuration files needed
  • Complex rules engine supporting conditionals, variables, and shell commands
  • Device-specific profiles that activate per keyboard
  • Hyper key support (remap Caps Lock to Ctrl+Shift+Option+Cmd simultaneously)
  • Community-maintained library of hundreds of importable rule sets

Comparison with Similar Tools

  • Hammerspoon — Lua-based macOS automation covering more than keyboard; no kernel driver
  • BetterTouchTool — Broader input customization (trackpad, Touch Bar) with a paid license
  • xmodmap / xkb — Linux keyboard remapping tools; not available on macOS
  • AutoHotkey — Windows-only scripting tool for keyboard and mouse automation
  • Kinto — Cross-platform key remapper focused on making macOS shortcuts work like Windows/Linux

FAQ

Q: Does Karabiner-Elements work on Apple Silicon Macs? A: Yes, it supports Apple Silicon natively since version 14.0.

Q: Will it slow down my keyboard input? A: No. The virtual keyboard driver processes events in microseconds, and the modification daemon adds negligible latency.

Q: Can I use different mappings per application? A: Yes. Complex rules support frontmost_application conditions so mappings only activate in specific apps.

Q: Is the kernel extension safe? A: The DriverKit-based virtual HID device runs in user space on modern macOS, avoiding traditional kernel extension risks. The project is auditable as open source.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产