X Tutup
Skip to content

Fix numpad emulation in 3d navigation shortcuts#110428

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
CookieBadger:fix-viewport-numpad-emulation
Nov 1, 2025
Merged

Fix numpad emulation in 3d navigation shortcuts#110428
akien-mga merged 1 commit intogodotengine:masterfrom
CookieBadger:fix-viewport-numpad-emulation

Conversation

@CookieBadger
Copy link
Contributor

Fixes #110427.

I was noticing this issue a while, and I saw it wasn't yet fixed for 4.5, so I tried a quick fix, but not sure if this duplicate workaround is how you would do it.

@CookieBadger CookieBadger requested a review from a team September 11, 2025 16:42
@CookieBadger CookieBadger force-pushed the fix-viewport-numpad-emulation branch from fe59c42 to 099c740 Compare September 11, 2025 17:20
@AThousandShips AThousandShips added bug topic:editor topic:3d cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Sep 12, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Sep 12, 2025
@CookieBadger
Copy link
Contributor Author

just noting, since it's marked for cherry pick: the issue probably also exists in versions prior to 4.4, but you have to first toggle emulate_numpad to encounter it.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (Linux/X11, fr-oss keyboard layout), it mostly works as expected.

Ctrl + 2 and Ctrl + Alt + 2 work, but not any of the other viewport split shortcuts like Ctrl + 1. They work after switching to QWERTY, so it's probably due to the original bindings.

To fix this, lines 9546-9551 of node_3d_editor_plugin.cpp should be changed to:

	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/1_viewport", TTRC("1 Viewport"), KeyModifierMask::CMD_OR_CTRL + Key::KEY_1, true), MENU_VIEW_USE_1_VIEWPORT);
	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports", TTRC("2 Viewports"), KeyModifierMask::CMD_OR_CTRL + Key::KEY_2, true), MENU_VIEW_USE_2_VIEWPORTS);
	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports_alt", TTRC("2 Viewports (Alt)"), KeyModifierMask::ALT + KeyModifierMask::CMD_OR_CTRL + Key::KEY_2, true), MENU_VIEW_USE_2_VIEWPORTS_ALT);
	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/3_viewports", TTRC("3 Viewports"), KeyModifierMask::CMD_OR_CTRL + Key::KEY_3, true), MENU_VIEW_USE_3_VIEWPORTS);
	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/3_viewports_alt", TTRC("3 Viewports (Alt)"), KeyModifierMask::ALT + KeyModifierMask::CMD_OR_CTRL + Key::KEY_3, true), MENU_VIEW_USE_3_VIEWPORTS_ALT);
	p->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/4_viewports", TTRC("4 Viewports"), KeyModifierMask::CMD_OR_CTRL + Key::KEY_4, true), MENU_VIEW_USE_4_VIEWPORTS);

This will make the bindings physical, so they work on any keyboard layout.

@CookieBadger CookieBadger force-pushed the fix-viewport-numpad-emulation branch from 099c740 to 9ec9d9a Compare September 15, 2025 19:44
@CookieBadger
Copy link
Contributor Author

@Calinou updated.

@CookieBadger CookieBadger force-pushed the fix-viewport-numpad-emulation branch from 9ec9d9a to e3eef8c Compare October 29, 2025 15:27
@CookieBadger
Copy link
Contributor Author

rebased.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally on Windows (AZERTY keyboard layout), it works as expected. Code looks good to me.

@akien-mga akien-mga merged commit 9a079cd into godotengine:master Nov 1, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga removed cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split viewport shortcuts don't work when emulate numpad is true

4 participants

X Tutup