这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@werifu
Copy link
Contributor

@werifu werifu commented Dec 16, 2022

Related issue and comment: #86 (comment)

When I am using a Chinese/Japanese input methods, TISCopyCurrentKeyboardInputSource would return NULL, leading to a segment fault in CFDataGetBytePtr(layout) because layout is NULL.

image

So I handled this case by using TISCopyCurrentKeyboardLayoutInputSource, inspired by a similar case in VSCode.
related issue: microsoft/vscode#23833 (comment)
and code: https://github.com/microsoft/node-native-keymap/blob/089d802efd387df4dce1f0e31898c66e28b3f67f/src/keyboard_mac.mm#L87

image

My environment:
MacOS 12.5 (Apple Silicon)
Rust 1.62.1

@CcSimple
Copy link

CcSimple commented Mar 9, 2023

It's very useful for me
thanks @werifu

@Narsil
Copy link
Owner

Narsil commented Mar 9, 2023

Ok, I cannot verify this atm, but having approval from another member of the community is good enough for me ! Merging.

@Narsil Narsil merged commit 3d0ec1d into Narsil:main Mar 9, 2023
TTWNO pushed a commit to TTWNO/rdev2 that referenced this pull request Jan 23, 2025
* fix: panic when using CJK input methods in macOS

* fix: format error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants