切换 ABC 和中文输入法时的 bug

Open
#102 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
swift
Domain
desktop

Research direction

This is a user bug report about a ~1s race between switching input sources (fn key) and key-event handling on macOS: shift+- emits _ or — depending on which layout the system still thinks is active, plus a separate IME-freeze report (screenshot linked). Start with the InputSourcePro Swift sources that perform input source switching and any code mapping key events/layouts, and check the other two comments on the issue for maintainer direction before writing code. Done means reproducing the race on macOS and identifying (or fixing) where the stale layout state persists after a switch.

Written by the indexing model from the issue text.

Description

当前如果是中文输入法,按 fn 键切换至 ABC 输入法,立即按住 shift + - 号键来连续输入下划线,会发现从第二个字符开始就变成了破折号,像这样:_——————。
反之如果是 ABC 输入法,按 fn 键切换至中文输入法,立即按住 shift + - 号键来连续输入破折号,会发现从第二个字符开始就变成了下划线,像这样:——_____

系统是 MacOS 26.4,测试过搜狗输入法、微信输入法与 ABC 输入法进行切换都有问题。要想没有问题,就需要在切换后等待大约 1 秒钟再按键。

这个问题与 InputSourcePro 似乎没有关系,但不知道发到哪里去求助。不知道大家有没有遇到过这种情况。

另外,还有个问题也一并求助大佬们。切换中文输入法后,可能出现输入法卡死的情况(见图),经常需要反复切换输入法数十次才能恢复。

Image
Dominant language
Swift
Stars
3.6k
Forks
144
Avg merge
4h 16m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runjuu/InputSourcePro

All issues in runjuu/InputSourcePro

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.