Skip to content

SSInput Improvement: ANY is the work of the devil - #5446

Merged
MistakeNot4892 merged 17 commits into
NebulaSS13:devfrom
francinum:ssinput-fc-input-fix
Sep 23, 2026
Merged

MistakeNot4892 merged 17 commits into
NebulaSS13:devfrom
francinum:ssinput-fc-input-fix

Conversation

@francinum

Copy link
Copy Markdown
Contributor

Description of changes

SSInput's macro set handling has been completely rewritten. The macrosets are now built per-player to allow avoiding the use of the ANY special macro, which breaks the ability to copy-paste out of output elements (like the chat). As well as playing havoc with the practically-undocumented ability for command elements to be prioritized for text input, assuming a compatible macro set is applied.

Why and what will this PR improve

Focus Chat control mode is now actually usable.

Authorship

This code is inspired by the original implementation of SSInput's keybinding systems, but has been practically completely rewritten at this point.

Changelog

🆑
refactor: The way hotkeys are bound has been rewritten completely.
add: Hotkey state is now saved to your preferences.
tweak: Default hotkeys for 'Focus Chat'/'Classic' mode have been audited.
/:cl:

A port of Daedalus' handling of input keys.
…mpts.

Properly protect hardcoded macros.
Prevent overbinding special macros.
I'm great at what I do.
Unit tests should return something.
Addresses keybinds.
@MistakeNot4892 MistakeNot4892 added the work in progress This PR is under development and shouldn't be merged. label Sep 3, 2026
Removes keyboard language nag
Maps ENTER, TAB, and BACKSPACE to BYOND key mappings.
@francinum

Copy link
Copy Markdown
Contributor Author

Still need to do:
Warning nag preference (And spans, They're directly imported from Daedalus and don't seem to exist in the old stylesheet)

@francinum
francinum marked this pull request as ready for review September 4, 2026 00:12
Comment thread code/modules/keybindings/setup.dm Outdated
if(prefs?.hotkeys)
winset(src, null, "outputwindow.input.focus=true input.background-color=[COLOR_INPUT_ENABLED]")
for(var/key in personal_macro_set) //We don't care about the bound key, just the key itself
var/keycode = replacetext(key, regex("(Alt|Shift|Ctrl)", "g"), "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be faster to compile this regex as a static reference somewhere?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should at least be pulled out of the loop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pulled both regexes out of their loop.

@Lohikar Lohikar added ready for review This PR is ready for review and merge. and removed work in progress This PR is under development and shouldn't be merged. labels Sep 10, 2026

@out-of-phaze out-of-phaze left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

partial review

Comment thread code/_helpers/global_lists.dm Outdated
Comment thread code/modules/client/preference_setup/controls/01_keybindings.dm Outdated
renames keybinding map list
renames focus chat nag var and savefile key

@MistakeNot4892 MistakeNot4892 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Willing to give this a shot considering any issues will likely be exposed by playtesting.

@MistakeNot4892

Copy link
Copy Markdown
Contributor

Going to merge this in as review was addressed and I want to see how it works during staging testing.

@MistakeNot4892
MistakeNot4892 merged commit 10a8853 into NebulaSS13:dev Sep 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review This PR is ready for review and merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants