Skip to content

Hide iPad modifier bar when a hardware keyboard is connected#35

Merged
thirteen37 merged 2 commits into
mainfrom
claude/ios-modifier-toolbar-keyboard-akeobj
Jun 23, 2026
Merged

Hide iPad modifier bar when a hardware keyboard is connected#35
thirteen37 merged 2 commits into
mainfrom
claude/ios-modifier-toolbar-keyboard-akeobj

Conversation

@thirteen37

Copy link
Copy Markdown
Owner

The on-screen modifier-key bar exists for touch/on-screen-keyboard users.
When a physical keyboard is attached its modifier keys are already
available, so the bar is redundant. Add PhysicalKeyboardObserver (backed
by GameController's GCKeyboard connect/disconnect notifications) and let
it suppress the bar; the user toggle still controls visibility otherwise,
and is disabled while a hardware keyboard is present.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01WaxWSS3sLMWVddxDtYxS4N

The on-screen modifier-key bar exists for touch/on-screen-keyboard users.
When a physical keyboard is attached its modifier keys are already
available, so the bar is redundant. Add PhysicalKeyboardObserver (backed
by GameController's GCKeyboard connect/disconnect notifications) and let
it suppress the bar; the user toggle still controls visibility otherwise,
and is disabled while a hardware keyboard is present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaxWSS3sLMWVddxDtYxS4N

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds iPad-specific behavior to suppress the on-screen modifier-key bar when a physical keyboard is present, while preserving the existing user toggle behavior when no hardware keyboard is connected.

Changes:

  • Introduces PhysicalKeyboardObserver (GCKeyboard connect/disconnect-backed) and a pure ModifierBarVisibility.shouldShow(...) rule.
  • Updates ViewerView to compute modifier bar visibility based on both the user toggle and hardware-keyboard presence, and disables the toggle while connected.
  • Adds unit tests covering the modifier-bar visibility precedence logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
KVMConsoleiPadTests/NanoKVMiPadTests.swift Adds unit tests for modifier-bar visibility precedence logic.
KVMConsoleiPad/UI/ViewerView.swift Uses PhysicalKeyboardObserver to hide the modifier bar when a hardware keyboard is connected and disables the toggle accordingly.
KVMConsoleiPad/Input/PhysicalKeyboardObserver.swift Implements keyboard connection tracking via GCKeyboard notifications and a testable visibility rule helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread KVMConsoleiPad/Input/PhysicalKeyboardObserver.swift Outdated
Combine already provides ObservableObject/@published; the file references
no SwiftUI symbols, so the import was unnecessary and coupled this input
utility to the UI framework.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaxWSS3sLMWVddxDtYxS4N

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@thirteen37 thirteen37 merged commit 68aa019 into main Jun 23, 2026
1 of 2 checks passed
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