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.
Believe it or not, copy-cut-paste on the Web platform seems to be completely broken. (I mean cut/copy/paste from outside to the game or from the game to outside.) Try it out. This PR fixes this.
Capture.video.du.2025-04-27.15-24-28.mp4
The issue is caused by the fact that we use
event.preventDefault()
for every key input. This makes it impossible for the browser to actually trigger and dispatch theClipboardEvent
needed to read the browser's clipboard. It is only available on transient user activation due to security considerations.So, I've added exceptions for {Ctrl,Cmd}-{X,C,V} (ctrl/cmd depends on the host). Keyboard-based copy/cut/paste aren't prevented by default, and this fixes the issues with copy/pasting.
So, it will be possible to copy/paste code from and to the browser. Very useful for code editors.