Skip to content

MacOS: Hỗ trợ phím Fn (Globe) và sửa một vài lỗi vặt#324

Open
luatnd wants to merge 2 commits into
tuyenvm:masterfrom
luatnd:master
Open

MacOS: Hỗ trợ phím Fn (Globe) và sửa một vài lỗi vặt#324
luatnd wants to merge 2 commits into
tuyenvm:masterfrom
luatnd:master

Conversation

@luatnd
Copy link
Copy Markdown

@luatnd luatnd commented May 21, 2026

New feat

  • Hỗ trợ chuyển E <-> V chỉ với 1 phím 🌐 Fn (Globe) như mặc định của MacOS mới, không cần nhấm tổ hợp phím nữa. Fn (🌐) single-press as language switch on modern Mac keyboards
    • New HAS_FN bit (0x1000) in the hotkey bitfield (Engine.h)
    • Fn-flag check in checkHotKey() (OpenKey.mm:503-504)
    • "🌐" checkbox in preferences (ViewController.m + storyboard)
    • Italic hint label about the System Settings → Keyboard → "Press 🌐: Do Nothing" requirement

Fix

  1. Lỗi không hiển thị UI do nhớ nhầm vị trí Bảng điều khiễn cũ ==> Căn vị trí mới khi hiển thị Bảng điều khiển. UI hang / unresponsive preferences — initEventTap was calling CFRunLoopRun() on the main thread, starting a nested loop that blocked AppKit from processing events (OpenKeyManager.m). Latent bug independent of the Fn feature.
  2. Preferences window invisible on macOS Tahoe — LSUIElement=true apps now need [NSApp activateIgnoringOtherApps:YES] before makeKeyAndOrderFront:, otherwise windows go behind the foreground app (AppDelegate.m).
  3. Window restored off-screen — saved frame from a prior multi-display setup placed the window at (1932, -804) (a disconnected external monitor). Added re-centering on [NSScreen screens].firstObject (AppDelegate.m).
  4. Storyboard layout overlap — first attempt placed the Fn checkbox on top of the existing "Chế độ gõ" radio row. Expanded the "Điều khiển" box from 112→137px, shifted the upper rows up, added a dedicated row for the hint label.

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.

2 participants