Skip to content

Add Keyboard method to open the Keyboard screen#14

Open
scmcgowen wants to merge 3 commits intoReconnectedCC:1.20.1from
scmcgowen:1.20.1
Open

Add Keyboard method to open the Keyboard screen#14
scmcgowen wants to merge 3 commits intoReconnectedCC:1.20.1from
scmcgowen:1.20.1

Conversation

@scmcgowen
Copy link

The Keyboard screen will forward mouse inputs scaled to the grid of the 2d canvas.

… forward mouse events, scaled to the 2d canvas when used by .captureInput()
@Ale32bit
Copy link

To clarify, this merge request implements a keyboard module method to open the keyboard "GUI" as if the player right clicked the module itself, right?

@scmcgowen
Copy link
Author

Yes, that is what it does, though interestingly right clicking the module no longer opens the NI's keyboard (unrelated to my PR, its something I noticed when testing)

@Ale32bit
Copy link

Is there any safe guard to prevent the player from being stuck in a loop that keeps opening the keyboard?

@scmcgowen
Copy link
Author

Currently, the best way would be to set plethora:keyboard:captureInput's base cost higher in the plethora config, however I am open to any suggestions on other ways to do that

@dimaguy
Copy link

dimaguy commented Nov 25, 2025

Is there any meaningful usecase for this? It feels prone to exploitation, especially if misconfigured by a server owner

@scmcgowen
Copy link
Author

scmcgowen commented Nov 25, 2025

The primary use case I envision is getting key and mouse input at the normal rate a terminal does on a keybind, such as for a NI chat system or a graphical menu using the Overlay Glasses.
The Keyboard alone doesn't give you mouse input, and also gives key presses at a faster rate, which is good for keybinds such as laser firing, but is not great for typing text into the overlay glasses.

@scmcgowen
Copy link
Author

I am open to suggestions on how to mitigate exploitability, however, and will consider any option to reduce the impact while not eliminating the envisioned primary use case

@dimaguy
Copy link

dimaguy commented Nov 26, 2025

I have a suggestion, what if instead of getting regular mouse output, which is only useful for 2d canvases, you threw a raycast and got an object on the 3d canvas it would return 3d coordinates and but if it hits a 2d overlay first it would return 2d coordinates.
Maybe the keyboard could have an advanced version with a different recipe for mouse input capability?

@scmcgowen
Copy link
Author

That sounds more complicated to implement, plus I'd have to get the 3d canvas to see what's on it to do a raycast. Seems interesting though, but also doesn't seem to prevent the problem of effectively softlocking yourself by calling it in a loop.

@dimaguy
Copy link

dimaguy commented Nov 26, 2025

I'm thinking that client side there could be an SOS option to disable the method taking effect on the client, on modmenu or something

@scmcgowen
Copy link
Author

image

@Ale32bit
Copy link

Also add a cooldown for the method after its GUI is closed, like a second or two.
Make it unable to open if any other GUI is open, including the pause menu.

@scmcgowen
Copy link
Author

I'll try to implement that tomorrow

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.

3 participants