Skip to content

Add control+v clipboard pasting#1298

Open
itsRevela wants to merge 1 commit intosmartcmd:mainfrom
itsRevela:feature/paste
Open

Add control+v clipboard pasting#1298
itsRevela wants to merge 1 commit intosmartcmd:mainfrom
itsRevela:feature/paste

Conversation

@itsRevela
Copy link

Description

- Adds control+v clipboard paste support to all text input fields, not just chat messages.

Changes

Previous Behavior

- control+v paste only worked in the chat screen. Other text input fields (server IP/port, world name, seed entry, signs) did not support pasting from the clipboard.

Root Cause

- The `WndProc` in `Windows64_Minecraft.cpp` detects control+v but only routes it to `ChatScreen::handlePasteRequest()`. The other text input paths (`UIScene_Keyboard` and `UIControl_TextInput`) never receive paste events because control+v doesn't produce a `WM_CHAR`, so the char buffer they consume never contains pasted text.

New Behavior

- Pressing control+v pastes clipboard text into any text input field, including server IP/port entry, world name, seed entry, and sign editing. Character limits are respected and control characters are filtered out.

Fix Implementation

- Added `#include "..\..\Screen.h"` to both files for access to `Screen::getClipboard()`
- Added control+v paste handling in `UIControl_TextInput::tickDirectEdit()` after the char consumption loop. Covers sign editing, seed entry, etc.
- Added control+v paste handling in `UIScene_Keyboard::tick()` after the char consumption loop. Covers server IP/port, world name, and other keyboard-scene fields, with support for both PC mode (insert at cursor) and non-PC mode (append)

AI Use Disclosure

- AI was not used to write the code in this PR.

Related Issues

- None

Previously paste only worked in the chat screen. Wire Screen::getClipboard() into the two remaining text input paths so Ctrl+V works for sign editing, seed entry, server IP/port, and world name fields.
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.

1 participant