Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GõKey crash khi khởi động trong trường hợp máy tính đang chọn Input source khác #48

Open
huytd opened this issue Mar 21, 2023 · 0 comments

Comments

@huytd
Copy link
Owner

huytd commented Mar 21, 2023

Trong trường hợp macOS đang chọn một input source khác ngoài tiếng Anh, thì GõKey sẽ bị crash.

Crash log:

Thread 0 Crashed:: main Dispatch queue: com.apple.main-thread
0   <translation info unavailable>           0x100c5be88 ???
1   goxkey                                 0x10053e81a DYLD-STUB$$CFAttributedStringSetAttribute + 6
2   libsystem_platform.dylib            0x7ff80bb23c33 _sigtramp + 51
3   goxkey                                 0x100467367 _$LT$rdev..macos..keyboard..Keyboard$u20$as$u20$rdev..rdev..KeyboardState$GT$::add::h86a93639157b1a20 + 119
4   goxkey                                 0x100353fe2 goxkey::input::build_keyboard_layout_map::h432c08493bce46be + 306
5   goxkey                                 0x10035432a goxkey::input::rebuild_keyboard_layout_map::h74d69ad26f4a8a05 + 362
6   goxkey                                 0x10036e3c7 goxkey::main::h64da65ddf89dbedb + 39
7   goxkey                                 0x10033a9a6 std::sys_common::backtrace::__rust_begin_short_backtrace::h30ab29c12f42fe74 + 6
8   goxkey                                 0x10036f02c std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h659a2a62d2f5f24f + 12
9   goxkey                                 0x100506e20 std::rt::lang_start_internal::h72dc55d09e0a2397 + 784
10  goxkey                                 0x10036e7fc main + 44
11  dyld                                   0x200a30310 start + 2432

Nguyên nhân là vì với các input source không phải mặc định, việc đọc thông tin keyboard layout sẽ trả về empty layout. Hiện tại bước này được xử lý từ thư viện rdev, nên GõKey không kiểm soát được.

Phương án là không xài rdev nữa mà tự viết lại binding để đọc input source và map layout phím.

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

No branches or pull requests

1 participant