Skip to content

Add onscreen keyboard controls for terminal interaction #560

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

aminzabardast
Copy link
Contributor

Introduce onscreen buttons for CTRL, ESC, UP, DOWN, LEFT, RIGHT, and TAB key simulations, enhancing user interaction with the terminal. Refactor existing code to improve functionality and styling of these controls. #557

@aminzabardast
Copy link
Contributor Author

The interface is simple and resembles the Options section that already exists. I'll add a better interface but that is just UI change. This is functional now. #557

@butlerx
Copy link
Owner

butlerx commented Apr 24, 2025

Can you post a screenshot

@butlerx butlerx requested a review from Copilot April 24, 2025 09:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds onscreen keyboard controls to enhance terminal interaction by simulating key presses for several keys. Key updates include the integration of onscreen button elements in the HTML, implementation of corresponding key press simulation functions in term.ts, and inclusion of a new keyboard icon in the client’s icon library.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/server/socketServer/html.ts Added onscreen button elements for terminal controls.
src/client/wetty/term.ts Introduced functions to simulate various key presses and toggle CTRL.
src/client/wetty.ts Updated FontAwesome icon imports and library initialization.
Files not reviewed (1)
  • src/assets/scss/options.scss: Language not supported
Comments suppressed due to low confidence (2)

src/client/wetty/term.ts:40

  • The variable 'crtlFlag' appears to be misspelled; consider renaming it to 'ctrlFlag' for clarity and consistency.
let crtlFlag = false; // This indicates whether the CTRL key is pressed or not

src/client/wetty/term.ts:207

  • The global declaration for 'toggleCTRL' expects a parameter (KeyboardEvent) but the implementation does not take any; update the declaration to 'toggleCTRL?: () => void;' to match the implementation.
toggleCTRL? : (event: KeyboardEvent) => void;

@aminzabardast
Copy link
Contributor Author

@butlerx I fixed the issues Copilot pointed out

@aminzabardast
Copy link
Contributor Author

  1. Virtual Keys Button
    1
  2. Virtual Keys Active
    2
  3. Keys when pressed
    3
  4. Ctrl key waiting for input, i.e. Ctrl + c
    4
  5. View in Safari
    5

@aminzabardast
Copy link
Contributor Author

@butlerx The UI is basic but functional. I'll work on a better interface after the functionality is settled.

@aminzabardast
Copy link
Contributor Author

@butlerx any feedback?

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.

2 participants