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

FIX getTextInput does nothing (DefaultLwjgl3Input.java-getTextInput) #7110

Closed
wants to merge 7 commits into from
Closed

FIX getTextInput does nothing (DefaultLwjgl3Input.java-getTextInput) #7110

wants to merge 7 commits into from

Conversation

deedywu
Copy link

@deedywu deedywu commented Mar 24, 2023

text field was fixed with swing on lwjgl3
then it can work on m1 osx and x86 windows11

5ae96484548713148755a8e19e7c1ebb

@deedywu deedywu changed the title IX getTextInput does nothing (lwjgl3) FIX getTextInput does nothing (DefaultLwjgl3Input.java-getTextInput) Mar 24, 2023
@tommyettinger
Copy link
Member

Can someone with a Mac test this, or tell me if using Swing in LWJGL3 is still a no-go?

@Frosty-J
Copy link
Contributor

This looks similar to gdx-dialogs, which works well with LWJGL3 (can cause crashing on Linux if you invoke it before libGDX initialises, but is always fine if after).

@deedywu
Copy link
Author

deedywu commented Mar 30, 2023

WechatIMG40

Can someone with a Mac test this, or tell me if using Swing in LWJGL3 is still a no-go?

YES,I built a game on m1pro mac used libgdx(mac of ARM support only lwjgl3),there are worked good

@deedywu deedywu closed this Mar 30, 2023
@deedywu deedywu reopened this Mar 30, 2023
@deedywu
Copy link
Author

deedywu commented Apr 10, 2023

It’s been two weeks since I made this PR. I am wondering why it is not being reviewed yet. Can someone have a look?

Copy link
Contributor

@intrigus intrigus left a comment

Choose a reason for hiding this comment

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

I really don't understand why this works.
My impression was always that Swing/AWT+LWJGL3 on macOS is a big no-no.

Is there a reason why you didn't copy the implementation of LWJGL2?

@Tom-Ski
Copy link
Member

Tom-Ski commented Apr 10, 2023

Is this tested without using the awt extension support?

@deedywu
Copy link
Author

deedywu commented Apr 10, 2023

I really don't understand why this works. My impression was always that Swing/AWT+LWJGL3 on macOS is a big no-no.

Is there a reason why you didn't copy the implementation of LWJGL2?

I am developing a small mobile game, but I need to debug it on the arm's Mac, which only supports building based on lwjgl3. Therefore, I have done the above work

@deedywu
Copy link
Author

deedywu commented Apr 10, 2023

Is this tested without using the awt extension support?

If there is no support for awt components, it may not be possible to listen to keyboard events properly, but input can still be done

/*** input number filter */
private static class PlainDocumentNumber extends PlainDocument {
@Override
public void insertString (int offset, String s, AttributeSet attrSet) throws BadLocationException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this implementation disallow inputting negative numbers?

Copy link
Member

Choose a reason for hiding this comment

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

As well as floating-point numbers, because of the '.'

Copy link
Author

Choose a reason for hiding this comment

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

Haha, this is indeed a bug, because my program is more restrictive, sorry, I will fix it for general purpose now

@deedywu deedywu closed this Jul 14, 2023
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.

None yet

5 participants