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

Add alt code input feature #9981

Closed
O-39889 opened this issue Jun 16, 2024 · 5 comments · May be fixed by godotengine/godot#93466
Closed

Add alt code input feature #9981

O-39889 opened this issue Jun 16, 2024 · 5 comments · May be fixed by godotengine/godot#93466

Comments

@O-39889
Copy link

O-39889 commented Jun 16, 2024

Describe the project you are working on

An incremental game (this is not really project specific, although I work with a lot of text strings like flavor text in it, so those small inconeniences might slowly accumulate over time)

Describe the problem or limitation you are having in your project

Using "alt codes" for entering special characters does not seem to work in the editor, including code editor, inspector input fields and other input fields in the editor. So, holding down Alt, then entering a valid numerical code on the numpad while Num Lock is active results in no special symbol being inserted. That includes the code editor and the editor input fields; and, since the editor is said to use the Godot UI system itself, it also extends to nodes like LineEdit in games as well.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add the alt code input functionality to the text editors.
I feel like I probably don't need to describe how it should work since it's base functionality in a lot of regular desktop programs such as text editors and web browsers.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Just like in most other text input fields in other programs, when the user holds Alt and types a combination of numbers on the numeric keypad while having Num Lock on and then releases Alt, the required symbol will be entered.

For example, Alt + 0151 corresponds to — (the em dash symbol)

If this enhancement will not be used often, can it be worked around with a few lines of script?

This can be worked around by just opening any text editor or any program with a text input field (such as a web browser), entering a combination in here and copying the resulting symbol.

Is there a reason why this should be core and not an add-on in the asset library?

I feel like it doesn't make sense for this feature to be a separate add-on or a library, considering how it's usually just supported out-of-the-box, so might either just add it as core functionality or not (and reject this proposal in the latter case).

@Calinou
Copy link
Member

Calinou commented Jun 16, 2024

Alt codes are already implemented in 4.0 and later: godotengine/godot#55441

Which Godot version are you using?

(This is active even on non-Windows platforms, even though alt codes are a Windows-only thing.)

@O-39889
Copy link
Author

O-39889 commented Jun 17, 2024

I'm using Godot 4.2.2, which is probably weird since it doesn't seem to work in here. Just to clarify, I'm using it exactly like in other Windows programs, as I described in my proposal, and it doesn't seem to work. Maybe I'm somehow using it the wrong way, not how it works in Godot, idk

@Rydian
Copy link

Rydian commented Jun 18, 2024

I'm using v4.3.beta1.official [a4f2ea91a] and it's not working in the code editor for me either. Neither is it working in the LineEdit test section of a theme resource, etc. ALT+0153 = ™ but it's not putting anything in that I can tell.

Pasting the symbol does work in both areas, so it's probably not a font/display issue.

@kitbdev
Copy link

kitbdev commented Jun 18, 2024

Godot has Unicode input (from godotengine/godot#55441), and it works slightly differently than Alt codes.
For Unicode input, Hold Alt, then type plus + on the numeric keypad, then type the unicode character value, and then release Alt.
For instance, U+2014 is em dash — and U+2122 is trademark ™.
For Alt codes, don't type plus + and it has different character values. Alt codes are Windows only.

@O-39889
Copy link
Author

O-39889 commented Jun 19, 2024

Well, okay, I see, I checked that and it does work that way indeed. Maybe it's less convenient for regular Windows users though, I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants