-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[3.x] Add support for multiple virtual keyboard types #58537
[3.x] Add support for multiple virtual keyboard types #58537
Conversation
082fb88
to
7dffa7f
Compare
@brianwinterpixel To avoid breaking compatibility, you can leave the original
Of course, this is only necessary where the function is publicly exposed (e.g: to gdscript), and the internal versions can be removed in favor of the new one. |
platform/android/java/lib/src/org/godotengine/godot/GodotIO.java
Outdated
Show resolved
Hide resolved
platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java
Outdated
Show resolved
Hide resolved
scene/gui/line_edit.h
Outdated
enum VirtualKeyboardInputType { | ||
KEYBOARD_TYPE_DEFAULT, | ||
KEYBOARD_TYPE_MULTILINE, | ||
KEYBOARD_TYPE_NUMBER, | ||
KEYBOARD_TYPE_NUMBER_DECIMAL, | ||
KEYBOARD_TYPE_PHONE, | ||
KEYBOARD_TYPE_EMAIL_ADDRESS, | ||
KEYBOARD_TYPE_PASSWORD, | ||
KEYBOARD_TYPE_URL | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to refer to the enum defined in os.h
instead of redefining a new one here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this pattern used elsewhere in the engine, such as Viewport::Usage
<-> VisualServer::ViewportUsage
.
There is a bit of an interdependency between OS
, core_bind.h::_OS
, and LineEdit
. To keep bindings straightforward, I think this is fine.
ded3316
to
3e599ac
Compare
@brianwinterpixel Were you able to address the review feedback? |
I believe so. It's been a while since I've touched this but if I recall correctly it should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really well implemented, kudos!
I'm reviewing a bit late to include it in 3.5 but this should be fine for 3.6. Would be good to get reviews from @godotengine/ios and @godotengine/html5 too.
platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java
Show resolved
Hide resolved
case KEYBOARD_TYPE_MULTILINE: { | ||
AppDelegate.viewController.keyboardView.keyboardType = UIKeyboardTypeDefault; | ||
} break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected that iOS doesn't have any multiline mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe there is any applicable multiline option for iOS. Someone else may know better.
See: https://developer.apple.com/documentation/uikit/uikeyboardtype?language=objc
3e599ac
to
e5f3d95
Compare
e5f3d95
to
c98cae3
Compare
Added my comment to the master branch version: #58536 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for Android!
c98cae3
to
ce24b48
Compare
Thanks! |
3.x version of #58536
Compatibility is maintained by retaining the old
OS::show_virtual_keyboard
function binding and adding a new binding forOS::show_virtual_keyboard_type
that allows specifying the virtual keyboard type.Differences between this PR and the linked 4.0 PR: