-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Native OSK #5611
Native OSK #5611
Conversation
kd-11
commented
Jan 29, 2019
•
edited
Loading
edited
- Implements a native osk input interface for use with a controller. Only ascii input in supported at the moment.
- Fixes a few bugs with the backend rendering of some native elements
- Improves font and text rendering system to support more glyphs and support more languages
I'll check my personal tests here: Games:
Flags:
TODO: (maybe at a later time)
|
Would it be possible to have backspace bound to some button? It's cubersome to move the cursor to that button every time one wants to erase something. Space as a button woudn't be too bad of an idea either. In addition I think the PS3 OSK also allows you to move the caret around, you could consider implementing that with shoulder buttons as well. Also I don't like having shift and accept/cancel as face buttons. A more natural spot for shift would be a shoulder button imo and start would be more fitting as an accept button. I'm not sure what to do with cancel though, maybe it could be placed on the keyboard with no button assigned to it. |
I don't have access to all buttons in native dialog right now without restructuring how pad input works. Caret itself doesn't exist yet as well and many other features. Right now its more important to just check that games do not crash. |
Added more buttons and remapped them to more closely match ps3. I think only the edit_text control remains, which will be important to support multiline and caret positioning. |
If you wait enough time (like ~5 seconds), Worms Ultimate Mayhem crashes after pressing Cancel or Accept. In master and this PR without enabling native user interface, works fine. Master: Native OSK in Minecraft works fine, without FPS goes up beyond 60 FPS. |
Added a proper edit control with support for multiline text if requested by the application. No scrolling available so you're limited to 3 lines max which should be good enough. Also adds a caret for visual feedback when space is pressed for example. |
How to cause the crash? I cannot get it to crash (tested with DeS) |
If the game sets a default text to OSK input, the caret stll starts at position 0. So if you'd want to replace it with your own text, you first have to keep tapping R1 untill you're at the other end before you can use backspace to erase it. Edit: Also, if there are multiple text boxes in row with default text then the carat spawns in the position it was when last text box was closed. Meaning that if you entered a 3-letter word in first one then caret will start at 3rd letter in next text dialog. |
@MSuih Fixed now. The crashes are possibly because the osk dialog never truly closes, just resets the interface. I must have failed to reset some variable. |
Identified a bug in the overlay renderer where resizing the window from 1280x720 breaks clip regions. This must have silently affected save dialog as well (I suspect some entries were cut off but it was not reported). Will push a fix asap. |
@kd-11 When I wanna erase space in default name of world, game crashes... |
And there is an isssue with special letters, but probably game crash is not caused by that. |
@mavethee What is the default world name? |
I think the issue he's having is that the default text contains non-ascii characters and your implementation assumes that only ascii characters have been entered. Maybe the backspace function uses a fixed chararter size or something? If you need a bandaid solution then wiping all non-ascii characters from default text could work. |
Backspace just does text.substr(), not sure how that would cause the crashing, but the out of range definately hints at something of the sort where the special character is larger than ascii limit of 128. I'll run some tests with some non-ascii characters and see if I can reproduce. |
Makes sense, we're unable to decode some of the characters. Will push a fix asap. |
Had to just strip all extended codes and replace with the character '#'. Fixes crashing on polish characters. If the '#' replacement is too jarring, I'm open to alternative placeholder characters. Note that the replaced character is 'real' in that it exists in the string if you choose to confirm it. Its not just a visual effect/trick. |
@kd-11 Works well, but can you replace '#' with normal letters? |
There are too many different variations for that to be feasible. For example there's over 30 different variations of letter A alone. |
Ouch. So only replacement with "#" left. But thanks for fixing that error with erasing space between words :) |
Too many variations unfortunately. Its really easy to write a replacement table manually but thats a tedious task given how many variations there are. I plan to eventually replace all text in the native UI with proper unicode support which will remove this limitation (all text variables encoded in utf-32). This is not going to happen any time soon though. |
@kd-11 Nice. I will be waiting and learn some more stuff, because I wanna help you guys. Going to IT school in Sempteber, but learning on my own it's probably better :P |
I'll hackishly map downward the characters instead of truly converting utf-16 to utf-8. Should help preserve characters in the high ascii range. |
Upgraded the text rendering system to use extended ascii with all text converted to this representation. This allows a lot more glyphs to render correctly, and (e.g) makes french text readable. Not all characters can be represented yet, but its at least a step to support more languages. |
- Allows for more complex interface design
- Adds all the major buttons to native dialog input options - Adds more button options for the native osk - Brighten osk cell backgrounds a bit to improve visibility
- Allows to disable cells from being selectable. - Edit text control adds proper support for multiline and a functioning caret
- Use custom string conversion to ensure overlay deals with extended ascii whenever possible - Improves language compatibility greatly and avoids empty spaces for unknown glyphs