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 TextEdit.virtual_keyboard_type like LineEdit.virtual_keyboard_type #7449

Open
acgc99 opened this issue Aug 5, 2023 · 2 comments
Open

Comments

@acgc99
Copy link

acgc99 commented Aug 5, 2023

Describe the project you are working on

A mobile app to track user progress in exercise.

Describe the problem or limitation you are having in your project

I found that for numeric inputs, LineEdit.virtual_keyboard_enabled and LineEdit.virtual_keyboard_type are useful. Although TextEdit.virtual_keyboard_enabled exists, TextEdit.virtual_keyboard_type doesn't.

I want a TextEdit with a numeric keyboard.

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

Add TextEdit.virtual_keyboard_type like LineEdit.virtual_keyboard_type.

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

Add that option in the inspector and via code.

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

I don't know.

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

For completeness.

@Calinou
Copy link
Member

Calinou commented Aug 5, 2023

I want a TextEdit with a numeric keyboard.

Out of curiosity, what do you need a purely numeric (multi-line) TextEdit for? Is this for a field where you're expected to write one number per line, or something like that?

@acgc99
Copy link
Author

acgc99 commented Aug 5, 2023

Out of curiosity, what do you need a purely numeric (multi-line) TextEdit for? Is this for a field where you're expected to write one number per line, or something like that?

That's the point!

I think this proposal could be useful if you want multiple numbers in different rows, instead of multiple LineEdit, a single TextEdit. This will probably be more used in apps, not games, for example, an app that displays data.

I don't think I'm going to use this directly in my app now (I don't know in the future) but this is related to a plugin I made to workaround my proposal #7193.

The plugin is FilteredEdits. I'm doing some work these days to fix and document bugs and limitations and add new features. From the begging, I added the functionality to clamp FilteredLineEdit text value (extends LineEdit). For generalizing, I recently worked to clamp values in FilteredTextEdit (extends TextEdit) line by line.

FilteredTextEdit will try to refuse characters accoding to its filter_mode. Let's asusme it is +0i so you can only type positive integers and zero. If the user types too fast, letters might pass the filter, I think this is because signals are emitted faster that the filtering method is called. One way to avoid this partially, is to use a numeric virtual keyboard.

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

No branches or pull requests

3 participants