Repository navigation
Conversation
lipceanu
force-pushed
the
mac-arrow-camera-keys
branch
from
October 27, 2026 00:50
7110f62 to
4dba64a
Compare
With DM_ARROWS=camera the arrow keys are the right stick (the camera in most 3D games), the D-pad moves to F T H G (left up right down) and the stick presses to V and B. Without it the keyboard is as before. The arrow keys held as the stick are released with the other keys when the window loses focus or the text box opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lipceanu
force-pushed
the
mac-arrow-camera-keys
branch
from
October 28, 2026 00:51
4dba64a to
5552bfb
Compare
Owner
|
Thanks @lipceanu for splitting out this keyboard camera layout and testing it in Breath of the Wild! Closing this PR because Still open: landing configurable keyboard remapping so players can map the camera directly to plain arrow keys if they prefer. |
chgpalmer
added a commit
to chgpalmer/nxnative
that referenced
this pull request
Nov 29, 2026
The Mac front end's half of the controller mapping (host/input: keymap.h, the remap in hle_hid.c): - In the game (front_mac.m, keyboard_mac.h): the keyboard goes through the map in place of the fixed key table, Shift, Control and Option keys included (flagsChanged). Each player's controller table goes to the host (dm_pad_map_set) at the start and after every change. - The mouse (mouselook_mac.h): with a mouse direction bound, a click on the game captures the pointer and its movement goes through keymap_mouse.h at 120 Hz, to player 1's sticks and buttons, or to the motion sensor as a controller turned in the hands (dm_motion_set_switch: upright in handheld mode, flat docked). Esc, a focus loss or the panel lets it go. - The settings window (Launcher.swift): Controls › Controller mapping › Customize…: a tab per player 1-8; player 1 has its keyboard and mouse or its controller; click a row and press a key or chord, click a mouse button, or press a controller's button or push its stick; right-click for Clear, Add Input… or a mouse direction; Mouse and trackpad puts the mouse on a stick or the motion controls with its sensitivity and Invert Y axis; a Preset menu per device (keymap_presets.h). Kept as the saved choice launcher.DM_KEYMAP, which launcher.c checks with the host's parser. - In the game, Window › Controller Mapping… (⌘⇧K, keymap_panel_mac.h) is the same map while playing: a change applies at once and is saved for the next start. - pad_apple.h's dm_pad_state is now the one reading of a GameController pad as the Switch's, used by the host's pad_read and the settings window's press-to-bind (pad_bridge.m). Covers seedds#2346 (mouse as a stick), seedds#2392's and seedds#356's asks (mouse look, the camera on plain arrows), the keyboard part of seedds#386 and seedds#2006's modifier keys; keys are tracked as pressed, so Shift let go before an arrow does not leave the right stick held (seedds#1535). Tests: test_launcher_storage (the window with the sheet's model), test_nsp_mac_app, test_docs, test_env_switches. Front-ends: new: launcher.DM_KEYMAP is a saved choice, checked by the host's parser (docs/frontends.md, Saved choices) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An opt-in keyboard layout for the Mac window,
DM_ARROWS=camera: the arrow keys become the right stick (the camera in most 3D games), the D-pad moves to F T H G (left, up, right, down) and the stick presses to V and B. Without the switch, the keyboard is unchanged.Split out of #301 at the reviewers' request.
Why
Without a controller, the Mac keyboard has no right stick: the arrow keys are the D-pad and the mouse is the touch screen, so in 3D games (Breath of the Wild, Tears of the Kingdom, Odyssey…) the camera can't be turned freely from the keyboard. The new layout puts the camera on the arrow keys, as MacNativeGames' keyboard layout does, while keeping the default layout for games that need the D-pad there.
How
dm/host/front_mac.monly:DM_ARROWS=camerais read at start, next toDM_PAD_MERGE/DM_KBD_PLAYER;key_bitremaps F T H G to the D-pad and V B to the stick presses;on_keyholds the arrows as the right stick's axes, passed todm_input_set'srx/ry;Testing
DM_ARROWS=camera; the log linefront end: the arrow keys are the right stick…confirms the switch, and no input problems came up. The individual key mappings were not checked one by one in game.clang -fsyntax-only -Wallon the currentmain; the one warning,activity, is in existing code.key_bit/on_key.🤖 Generated with Claude Code