mac-left-option-ime-switcher

A macOS global automation setup and troubleshooting guide to temporarily switch input methods while holding the left Option key. Intended for users who want left-Option-hold input-method switching on Mac, particularly between Sogou and Doubao input methods. The approach is based on Hammerspoon keyboard-event listening and involves accessibility/input-monitoring permission configuration; the workflow can be shared with colleagues.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "mac-left-option-ime-switcher" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-467f7e1756e8c0adea7ff87b609756f0c255a07a230c4243c1f8f99175dea5fb. Verify the upstream source and version against https://skillhub.cn/skills/user_b85d9503/option-input-switch before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A macOS global automation setup and troubleshooting guide to temporarily switch input methods while holding the left Option key. Intended for users who want left-Option-hold input-method switching on Mac, particularly between Sogou and Doubao input methods. The approach is based on Hammerspoon keyboard-event listening and involves accessibility/input-monitoring permission configuration; the workflow can be shared with colleagues.

0 Downloads

Introduction source: third_party · user_b85d9503 · 1.0.0 Reference

SkillPi interpretation

Tasks
Install and troubleshoot a macOS global automation that temporarily switches input methods while the left Option key is held. Use when a user wants Mac left Option hold-to-switch behavior, especially Sogou-to-Doubao IME switching, Hammerspoon-based keyboard event monitoring, Accessibility/Input Monitoring permission setup, or sharing this workflow with coworkers.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: mac-left-option-ime-switcher
description: Install and troubleshoot a macOS global automation that temporarily switches input methods while the left Option key is held. Use when a user wants Mac left Option hold-to-switch behavior, especially Sogou-to-Doubao IME switching, Hammerspoon-based keyboard event monitoring, Accessibility/Input Monitoring permission setup, or sharing this workflow with coworkers.

Mac Left Option IME Switcher

Use this skill to install a Hammerspoon automation on macOS:

  • Hold left Option: switch to Doubao IME.
  • Release left Option: switch back to Sogou IME.
  • Right Option is ignored.
  • Other key events are observed only and not swallowed.

The tested input source IDs are:

  • Sogou: com.sogou.inputmethod.sogou.pinyin, fallback com.sogou.inputmethod.pinyin
  • Doubao: com.bytedance.inputmethod.doubaoime.pinyin

Workflow

  1. Run scripts/install_left_option_ime_switcher.sh.
  2. If the script opens System Settings, make sure Hammerspoon is enabled in both:
    • Privacy & Security > Accessibility
    • Privacy & Security > Input Monitoring
  3. Restart Hammerspoon when macOS asks, or run:
osascript -e 'tell application "Hammerspoon" to quit' || true
open -g /Applications/Hammerspoon.app
  1. Ask the user to test a real left Option press and release.
  2. Inspect ~/.hammerspoon/left_option_ime.log if anything fails.

Important Details

  • Prefer Hammerspoon over a custom LaunchAgent for this workflow. On recent macOS versions, raw event taps may need both Accessibility and Input Monitoring; Hammerspoon handles this more predictably once it has permissions.
  • If Hammerspoon is running from Downloads via App Translocation, copy it to /Applications/Hammerspoon.app and launch it from there.
  • Stop any older custom helper named com.local.left-option-ime-switcher to avoid duplicate logic.
  • Use hs.keycodes.currentSourceID(...) for switching, not keyboard shortcuts.
  • Left Option keyCode is 58; right Option is different and should be ignored.

Verify

Run:

osascript -e 'tell application "Hammerspoon" to execute lua code "return hs.inspect({secure=hs.eventtap.isSecureInputEnabled(), tap=leftOptionImeTap and leftOptionImeTap:isEnabled(), current=hs.keycodes.currentSourceID(), methods=hs.keycodes.methods(true)})"'
tail -n 80 ~/.hammerspoon/left_option_ime.log

Expected:

  • secure = false
  • tap = true
  • input methods include Sogou and Doubao source IDs
  • log records select ...doubao... on left Option down and select ...sogou... on release

If simulated events work but real key presses do not, Input Monitoring permission is missing or stale. Open:

open 'x-apple.systempreferences:com.apple.preference.security?Privacy_ListenEvent'

Then add or enable /Applications/Hammerspoon.app.

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value65/100

Highlights

  • 提供 macOS 下基于 Hammerspoon 的输入法切换自动化方案,针对搜狗与豆包输入法用户有明确实用价值
  • 功能闭环完整,包含安装、配置、验证和排查全流程
Trigger Precision85/100

Highlights

  • description 在 frontmatter 中完整定义,覆盖安装、权限设置、排查和共享等多种使用场景
  • 触发词清晰,边界明确,不易与其他 Skill 混淆
Structure and Standards88/100

Areas to improve

  • 缺少 When to Use 显式章节 Reported severity: Minor

    文档未设置显式的 When to Use 章节,但使用场景已在 description 和正文中充分覆盖

    Recommendation: 建议增加 When to Use 章节以提升结构规范性

Highlights

  • 文档结构清晰,包含 Workflow、Important Details、Verify 等实用章节
  • 步骤明确,提供了具体命令和验证方式,frontmatter 完整
Execution Reliability82/100

Highlights

  • 提供了完整的权限设置指引和日志检查方法
  • 包含验证命令和常见问题排查路径,提升了执行成功率
Evidence Verifiability (mean of the first four)80/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.