[CRD iOS] Handle External Keyboard |
|
Issue descriptionCurrently the client doesn't work properly when the phone is connected to an external keyboard. The ClientKeyboard view for capturing keyboard input is not added to the HostView until the user tap "Show Keyboard", and it couldn't capture modifier keys.
,
Aug 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5c0e55b5f0d47f4893f6458a2f8f0138ecf22847 commit 5c0e55b5f0d47f4893f6458a2f8f0138ecf22847 Author: Yuwei Huang <yuweih@chromium.org> Date: Fri Aug 04 18:23:04 2017 [CRD iOS] Always keep ClientKeyboard first responder Looks like in some weird situations the soft keyboard will still show up even when the physical keyboard is presented (maybe input method dependent). In this case key injection will not work until the user taps "Show Keyboard", which also brings the soft keyboard... This CL fixes this scenario by always making ClientKeyboard the first responder and hide or show the keyboard by changing the inputView. By doing so ClientKeyboard can always capture key input even if the keyboard is not shown. This can also improve the experience when the user plugs in a keyboard in the middle of a session, although we still couldn't hide the toggle keyboard button on the fly. Bug: 749964 Change-Id: Ie7f52c4e99158958fb49d186473755f4bcc011a0 Reviewed-on: https://chromium-review.googlesource.com/599216 Reviewed-by: Scott Nichols <nicholss@chromium.org> Commit-Queue: Yuwei Huang <yuweih@chromium.org> Cr-Commit-Position: refs/heads/master@{#492075} [modify] https://crrev.com/5c0e55b5f0d47f4893f6458a2f8f0138ecf22847/remoting/ios/app/host_view_controller.mm [modify] https://crrev.com/5c0e55b5f0d47f4893f6458a2f8f0138ecf22847/remoting/ios/app/physical_keyboard_detector.h [modify] https://crrev.com/5c0e55b5f0d47f4893f6458a2f8f0138ecf22847/remoting/ios/client_keyboard.h [modify] https://crrev.com/5c0e55b5f0d47f4893f6458a2f8f0138ecf22847/remoting/ios/client_keyboard.mm
,
Aug 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/51203250c1851aae4714d144fde6c9a6b7ae8531 commit 51203250c1851aae4714d144fde6c9a6b7ae8531 Author: Yuwei Huang <yuweih@chromium.org> Date: Tue Aug 08 19:23:44 2017 [CRD iOS] Fix bug when tapping hide keyboard button on the soft keyboard Normally a view shows and hides the keyboard by becoming or resigning first responder (similar to the idea of a "focused text input"), but in our app we try to always keep the ClientKeyboard view the first responder and toggle the keyboard by replacing the view's inputView so that ClientKeyboard can always handle hardware key input even when the soft keyboard is not showing. This doesn't work well with the hide keyboard button on the soft keyboard. It will try to call [ClientKeyboard resignFirstResponder], which makes ClientKeyboard no longer able to handle hardware key input and put the view into inconsistent state. This CL fixes that issue by translating the action of resigning first responder when the soft keyboard is showing into hiding the soft keyboard using ClientKeyboard's logic and keeping the first responder state. This is based on the assumption that we only have one responder on the screen and is probably the best we can get... Bug: 749964 Change-Id: I5cc1ede06972a238557736edf3896283a9688200 Reviewed-on: https://chromium-review.googlesource.com/604750 Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org> Commit-Queue: Yuwei Huang <yuweih@chromium.org> Cr-Commit-Position: refs/heads/master@{#492724} [modify] https://crrev.com/51203250c1851aae4714d144fde6c9a6b7ae8531/remoting/ios/client_keyboard.h [modify] https://crrev.com/51203250c1851aae4714d144fde6c9a6b7ae8531/remoting/ios/client_keyboard.mm |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Jul 29 2017