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

Clear EventSystem's current selection when the console window is hidden #85

Merged
merged 4 commits into from
Jul 8, 2023

Conversation

emredesu
Copy link
Contributor

@emredesu emredesu commented Jul 1, 2023

... because it causes a lot of unintended behaviour, especially on mobile devices.

As the console window's GameObject is not disabled when the console window is not closed, the EventSystem still keeps the last selected item in the console window as its selected item, as can be seen on the screenshot below.

Untitled

This causes some key presses to cause weird behaviour. Especially on mobile (Android), I had the system keyboard randomly pop up during gameplay, because even though the command InputField was hidden, the EventSystem still considered it selected, which caused my "jump" button (gamepad south button, which also happens to be the "Confirm" button in Unity's default EventSystem controls) to be opened.

@yasirkula
Copy link
Owner

It makes sense. But instead of creating a new function, please inline the new code and follow the same coding style there (also CRLF and tabs must be used). A little more context in the comment is also appreciated so that people can understand why the call is necessary. A link to this pull request in the comment would be very helpful in that regard.

@yasirkula
Copy link
Owner

I think something is wrong with line endings because the whole file is marked as dirty now. I wonder if the file's line endings weren't CRLF to begin with. Either that or the current line endings aren't CRLF, I'm not sure which.

@emredesu
Copy link
Contributor Author

emredesu commented Jul 4, 2023

Upon further inspection, I am seeing that the original file has LF line endings (could be caused by having git config --global core.autocrlf true which automatically converts line endings to LF), which is causing the diff problem. I can convert the commit to LF to fix the diff or you could merge this to convert it back to CRLF, though it seems like the rest of the project also uses LF line endings so that could be a bad idea.

@yasirkula
Copy link
Owner

Converting it back to LF to minimize the diff seems like the best option, thank you for the detailed explanation.

@emredesu
Copy link
Contributor Author

emredesu commented Jul 4, 2023

image

Seems to have fixed it 👍

@yasirkula yasirkula merged commit 474f4ae into yasirkula:master Jul 8, 2023
@yasirkula
Copy link
Owner

Thanks!

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.

2 participants