elementary / switchboard-plug-mouse-touchpad

Switchboard Mouse & Touchpad Plug
GNU General Public License v3.0
24 stars 13 forks source link

Highlight cursor setting makes Ctrl remove focus from input #96

Closed cshaa closed 4 years ago

cshaa commented 5 years ago

Describe the bug

When the option "Highlight cursor: Pressing Ctrl will highlight the position of the cursor" (sorry if the translation is not literal) is activated, pressing Ctrl causes text input fields to lose focus until the key is let up again. This causes some aplications that change cursor position based on focus to behave badly. For example, the web application Messenger moves the cursor to the beginning of input on every focus event. This causes combinations like Ctrl+Backspace and Ctrl+Arrow completely useless.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Mouse and touchpad in Switchboard
  2. Enable the Highlight cursor option
  3. Open this website in a browser: https://jsfiddle.net/r6co502L/1/
  4. Click on the textarea
  5. Write something
  6. Press Ctrl+Left Arrow

Expected behavior

The textarea shouldn't lose focus.

Acutal behavior

The textarea loses focus when Ctrl is down and regains it when Ctrl is up.

Screenshots or screen recordings

obrazek

Platform Information

obrazek

Additional context

bumper314 commented 4 years ago

Nice jsfiddle testcase. In my testing…

  1. With "Reveal pointer" enabled, pressing Ctrl does blur (lose focus) of the textfield, but I was able to press left arrow or Backspace and they worked as expected (i.e. move the cursor 1 word, delete 1 word). If it doesn't work for @m93a, then perhaps there's an interaction with the Language/Input Method selection. I'm using English, what are you using?

  2. Pressing the Meta key also causes the textfield to blur, even with Keyboard > Layout > "⌘ key behavior" => Disabled. I didn't notice any adverse effects, I just thought it was worth mentioning. Conceivably, any action that causes a field to lose focus unexpectedly could have unforeseen consequences.

cshaa commented 4 years ago
  1. Can confirm that the textfield regains focus as soon as I press an arrow, even with Czech keyboard layout. But this is still enough to mess up some (arguably badly written but nonetheless popular) applications, for example Facebook's Messenger.
  2. Can confirm this as well. I opened an issue for it in the corresponding repo.
danirabbit commented 4 years ago

Closing as a duplicate of #81