Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI: Handle Copy and Paste events in ConsoleDialog #5427

Merged
merged 1 commit into from Nov 14, 2023

Conversation

sluicebox
Copy link
Member

ConsoleDialog had a hard-coded handler for Copy and Paste shortcuts. These shortcuts are now handled by the keymapper and produce Copy and Paste events.

Fixes CTRL+C and CTRL+V in the console on Windows builds.

ConsoleDialog had a hard-coded handler for Copy and Paste
shortcuts. These shortcuts are now handled by the keymapper
and produce Copy and Paste events.

Fixes CTRL+C and CTRL+V in the console on Windows builds.
Copy link
Contributor

coderabbitai bot commented Nov 13, 2023

Walkthrough

Walkthrough

The update involves refactoring the ConsoleDialog class by introducing a new function handleOtherEvent to manage custom engine actions specifically for copying and pasting text. This change streamlines the handling of these actions by moving the relevant code from the specialKeys function to the new handleOtherEvent, thus cleaning up the specialKeys function and enhancing the class interface.

Changes

File Change Summary
gui/console.cpp Added handleOtherEvent function to handle copy and paste actions; removed copy and paste handling from specialKeys function.
gui/console.h Added declaration for new handleOtherEvent function, updating the ConsoleDialog class interface.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@bluegr
Copy link
Member

bluegr commented Nov 14, 2023

Just tested this, works great! Many thanks, the missing copy/paste functionality in the console has been bugging me for ages

@bluegr bluegr merged commit 7930e28 into scummvm:master Nov 14, 2023
8 checks passed
@sluicebox sluicebox deleted the console-copypaste branch November 16, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants