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

Request: be able to select text with Shift + Arrow Keys #942

Closed
KeronCyst opened this issue Nov 21, 2019 · 3 comments
Closed

Request: be able to select text with Shift + Arrow Keys #942

KeronCyst opened this issue Nov 21, 2019 · 3 comments

Comments

@KeronCyst
Copy link

Bluetooth keyboards can do this when connected to the device.

rom1v added a commit that referenced this issue May 28, 2020
This allows to select text with Shift + arrow keys.

Fixes <#942>.
rom1v added a commit that referenced this issue May 28, 2020
This allows to select text with Shift + arrow keys.

Fixes #942 <#942>.
rom1v added a commit that referenced this issue May 28, 2020
This allows to select text with Shift + arrow keys.

Fixes #942 <#942>.
@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

I implemented forwarding SHIFT, and injecting COPY on Ctrl+c (if Android >= 7, like I do for paste since v1.14).

Here is a branch: copy.

Unfortunately, there is a bug on Android (at least on my ROM on One Plus 7 Pro).

To reproduce:

  • select any text and click on Copy
  • click somewhere in the middle of a text in a textfield, it should show a dialog containing Paste and Select all
  • when this dialog is displayed, press Shift+ (left)

dialog

On my device, it crashes (100% reproducible):

E MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E MessageQueue-JNI: java.lang.IllegalArgumentException
E MessageQueue-JNI: 	at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:35)
E MessageQueue-JNI: 	at android.widget.SelectionActionModeHelper$TextClassificationHelper.init(SelectionActionModeHelper.java:1062)
E MessageQueue-JNI: 	at android.widget.SelectionActionModeHelper.resetTextClassificationHelper(SelectionActionModeHelper.java:468)
E MessageQueue-JNI: 	at android.widget.SelectionActionModeHelper.resetTextClassificationHelper(SelectionActionModeHelper.java:476)
E MessageQueue-JNI: 	at android.widget.SelectionActionModeHelper.startSelectionActionModeAsync(SelectionActionModeHelper.java:123)
E MessageQueue-JNI: 	at android.widget.Editor.startSelectionActionModeAsync(Editor.java:2154)
E MessageQueue-JNI: 	at android.widget.Editor.refreshTextActionMode(Editor.java:2099)
E MessageQueue-JNI: 	at android.widget.TextView.spanChange(TextView.java:10719)
E MessageQueue-JNI: 	at android.widget.TextView$ChangeWatcher.onSpanChanged(TextView.java:13446)
E MessageQueue-JNI: 	at android.text.SpannableStringBuilder.sendSpanChanged(SpannableStringBuilder.java:1322)
E MessageQueue-JNI: 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:767)
E MessageQueue-JNI: 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:691)
E MessageQueue-JNI: 	at android.text.Selection.extendSelection(Selection.java:175)
E MessageQueue-JNI: 	at android.text.Selection.extendSelection(Selection.java:167)
E MessageQueue-JNI: 	at android.text.Selection.extendLeft(Selection.java:396)
E MessageQueue-JNI: 	at android.text.method.ArrowKeyMovementMethod.left(ArrowKeyMovementMethod.java:72)
E MessageQueue-JNI: 	at android.text.method.BaseMovementMethod.handleMovementKey(BaseMovementMethod.java:165)
E MessageQueue-JNI: 	at android.text.method.ArrowKeyMovementMethod.handleMovementKey(ArrowKeyMovementMethod.java:65)
E MessageQueue-JNI: 	at android.text.method.BaseMovementMethod.onKeyDown(BaseMovementMethod.java:42)
E MessageQueue-JNI: 	at android.widget.TextView.doKeyDown(TextView.java:8498)
E MessageQueue-JNI: 	at android.widget.TextView.onKeyDown(TextView.java:8229)
E MessageQueue-JNI: 	at android.view.KeyEvent.dispatch(KeyEvent.java:2801)
E MessageQueue-JNI: 	at android.view.View.dispatchKeyEvent(View.java:13435)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1937)
E MessageQueue-JNI: 	at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:460)
E MessageQueue-JNI: 	at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1874)
E MessageQueue-JNI: 	at android.app.Activity.dispatchKeyEvent(Activity.java:3971)
E MessageQueue-JNI: 	at android.support.v4.app.SupportActivity.superDispatchKeyEvent(ComponentActivity.java:108)
E MessageQueue-JNI: 	at android.support.v4.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
E MessageQueue-JNI: 	at android.support.v4.app.SupportActivity.dispatchKeyEvent(ComponentActivity.java:126)
E MessageQueue-JNI: 	at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:535)
E MessageQueue-JNI: 	at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
E MessageQueue-JNI: 	at android.support.v7.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2533)
E MessageQueue-JNI: 	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:374)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5771)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5639)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5121)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5174)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5140)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5280)
E MessageQueue-JNI: 	at android.view.ViewRootImpl$Input

EDIT: reported here: https://issuetracker.google.com/issues/157583090

rom1v added a commit that referenced this issue May 28, 2020
This allows to select text with Shift + arrow keys.

Fixes #942 <#942>.
rom1v added a commit that referenced this issue May 29, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue May 29, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Jun 1, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Jun 4, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
@rom1v
Copy link
Collaborator

rom1v commented Jun 5, 2020

rom1v added a commit that referenced this issue Jul 16, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Jul 16, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Jul 17, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Aug 1, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
rom1v added a commit that referenced this issue Aug 1, 2020
This allows to select text using Shift+(arrow keys).

Fixes #942 <#942>
@rom1v
Copy link
Collaborator

rom1v commented Aug 1, 2020

Fixed by #1598.

@rom1v rom1v closed this as completed Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants