• src/conio/cg_events.m src/syncterm/syncterm.h

    From Deuc@VERT to Git commit to main/sbbs/master on Tuesday, May 05, 2026 15:06:42
    https://gitlab.synchro.net/main/sbbs/-/commit/fbe34d8b32fcc7ef18cee1a1
    Modified Files:
    src/conio/cg_events.m src/syncterm/syncterm.h
    Log Message:
    Quartz: map Command (not Option) to Alt; Option reserved for IME

    Quartz keyDown previously routed the Option modifier into the AT
    scancode table's .alt slot. That conflicted directly with macOS's
    input-method system: Option-H/E/I/N/U/grave are dead-key composition
    triggers, so AppKit buffered the keystroke waiting for the follow-up
    letter and the view's keyDown: never fired -- making half a dozen
    Alt-letter shortcuts (Alt-H hangup chief among them) silently dead.

    This commit flips the modifier mapping:

    - Command -> Alt for the scancode table (Cmd-H now produces the
    Alt-H AT scancode 0x2300, Cmd-B = Alt-B, etc.).
    - Option is no longer a modifier check anywhere in keyDown:; it's
    left to AppKit's input method, so dead-key composition and
    foreign-keyboard layouts work normally. Composed characters
    arrive via NSEvent.characters and flow through the existing
    cpchar_from_unicode_cpoint() codepage translation, so CP437's
    accented letters (, , , , ...) get folded onto their
    codepage bytes when typed via Option deadkeys.

    - Cmd-Q and Cmd-V remain reserved for the macOS quit / paste
    conventions and are intercepted as CIO_KEY_QUIT / CIO_KEY_SHIFT_IC
    before the Cmd->Alt path takes effect.
    - Opt-Enter (toggle fullscreen) and Opt-Left/Right (snap resize)
    are also unchanged; these don't conflict with deadkeys because
    Return / arrow keys aren't IME composition triggers.

    - The codepage gate for diacriticals drops the previous "ch < 128"
    check; the unmapped fallback parameter does the right thing for
    high-Unicode codepoints (returns 0 when the codepage doesn't map
    them, falling cleanly through to the scancode table).

    ALT_KEY_NAME / ALT_KEY_NAMEP / ALT_KEY_NAME3CH on Apple builds change
    from "OPTION"/"Option"/"OPT" to "COMMAND"/"Command"/"CMD" so help
    text generated from those macros reads "Cmd-B" instead of "Opt-B".

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net