New issue
Advanced search Search tips

Issue 749964 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug


Participants' hotlists:
CRD-iOS-backlog


Sign in to add a comment

[CRD iOS] Handle External Keyboard

Project Member Reported by yuweih@chromium.org, Jul 28 2017

Issue description

Currently 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.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/39c5924b9e39ebe04e7f46be360a671b78b30906

commit 39c5924b9e39ebe04e7f46be360a671b78b30906
Author: Yuwei Huang <yuweih@chromium.org>
Date: Sat Jul 29 03:23:32 2017

[CRD iOS] Basic support for physical keyboard

This CL has these changes:
* Added an PhysicalKeyboardDetector for detecting physical keyboard.
* When the client is connected to the host and the physical keyboard is
  presented, we hide the Show/Hide Keyboard button and add immediately
  add the ClientKeyboard view to the HostView so that it can capture
  key input.

Bug: 749964
Change-Id: I2af7932d9fab2302e7d5cf8b7b59732087acf827
Reviewed-on: https://chromium-review.googlesource.com/590829
Reviewed-by: Scott Nichols <nicholss@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490603}
[modify] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/app/BUILD.gn
[modify] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/app/host_view_controller.mm
[add] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/app/physical_keyboard_detector.h
[add] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/app/physical_keyboard_detector.mm
[modify] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/client_keyboard.h
[modify] https://crrev.com/39c5924b9e39ebe04e7f46be360a671b78b30906/remoting/ios/client_keyboard.mm

Project Member

Comment 2 by bugdroid1@chromium.org, 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

Project Member

Comment 3 by bugdroid1@chromium.org, 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