elementary / switchboard-plug-keyboard

Switchboard Keyboard Plug
GNU General Public License v2.0
28 stars 22 forks source link

Not possible to create custom keyboard shortcut when the keyboard shortcut window is open directly from the main menu (for non-US layouts) #361

Closed remalhaut closed 3 years ago

remalhaut commented 3 years ago

What Happened

When creating a custom keyboard, clicking the "+" button creates a temporary entry. However, when I attempt to type in a command, the search box is activated instead and the temporary entry is lost. This happens even if previously selecting the temporary entry via mouse. EDIT: This was for the UK keyboard layout. After adding the US layout and switching to it, it is now possible to add new shortcuts and edit them. When I switch back to the original layout, I can edit the existing shortcuts, but still cannot add new shortcuts. EDIT 2: I just realized this only happens when I access the Keyboard Shortcuts window directly through the main menu. When I start with the System Settings window, the GTK search bar is greyed out and doesn't interfere with the command entry.

Expected Behavior

The text typed in should show up in the dialog box that reads "Enter Command".

Steps to Reproduce

  1. Begin with a non-US keyboard layout (I tried UK and PT).
  2. Open the Keyboard Shortcuts window directly through the main menu. Notice the search box is active. image
  3. Select "Custom" in the sidebar.
  4. Click "+" to create a new custom keyboard shortcut.
  5. Type in the new command. This activates the search box and the new entry is lost.
  6. Add the generic US keyboard layout and switch to it.
  7. Try to add a new custom keyboard layout. It can now be added as expected.
  8. Switch back to layout of choice. New shortcuts work and can be edited, but it still isn't possible to add new shortcuts.
  9. Open the main System Settings window via the main menu. Select the Keyboard plug. Notice the search box is now greyed out. image
  10. Custom keyboard shortcut creation now works as expected.

Platform Information

jeremypw commented 3 years ago

I am not getting this issue on elementary 6.0 daily. Please could you give details to which version of elementary you are using.

remalhaut commented 3 years ago

Sorry for the editing earlier. I added more system information to the first entry. I also changed the subject. It looks like everything works fine for the US keyboard layout but fails for other layouts (UK and PT in my attempts)

jeremypw commented 3 years ago

I am using a default UK English keyboard layout without experiencing this issue. Same plug version. Also tried Portuguese layout with problem. I have disabled the CapsLock but that is the only non-standard thing I can think of. I have no input methods and IBus is not running.

remalhaut commented 3 years ago

I just tried reinstalling the beta and updating everything through the Appcenter and I still get the same problem. Should I be installing the daily instead?

jeremypw commented 3 years ago

I just noticed that if you select an existing custom command with the keyboard, not by clicking on it, then it does not enter edit mode. The row is just highlighted. If the row is not in edit-mode (i.e. an entry box appears with the cursor in it) then typing on the keyboard does open the Gtk searchbox associated with the widget. (I was thinking you were referring to the search box in the headerbar). Is this what is happening to you? You must click on the name part of the command row (not the shortcut button) in order to edit it.

jeremypw commented 3 years ago

The Gtk searchbox is used for searching for a particular row in the view. I am not sure it actually useful in this case as you are unlikely to have enough custom command rows to require search assistance. Maybe we should disable it and switch to edit-mode automatically if you start typing.

jeremypw commented 3 years ago

I seem to remember that there was a bug in Files where switching layouts in the middle of an file rename caused the entry to lose focus and close. It should not happen if you are just typing normal character with an XKB layout though.

jeremypw commented 3 years ago

You can demonstrate this by starting to edit a custom command and then press <Alt><Shift> or <Shift><RightShift> to switch to another layout. The edit will end and subsequent characters will be treated as a row search request.

jeremypw commented 3 years ago

There is a combobox under SystemSettings/Keyboard/Layout where you can disable keyboard layout switching or choose a combination that it is less easy to hit accidentally.

remalhaut commented 3 years ago

Well, this is extremely weird: I tried adding a new shortcut again but I noticed this time the GTK search box was disabled transitioning from the main settings window to the keyboard settings window. Now everything works as expected and I'm doubting my sanity. Let me know, devs: should I leave this open or close the issue?

remalhaut commented 3 years ago

OK, after logging out and back in, I think I've figured it out:

image

jeremypw commented 3 years ago

Well spotted! I always open settings from the dock so I would never have seen that. I think the best thing to do is close this and open a new more general issue against the switchboard repo as this bug affects all the plugs (try search for "display" in Applications Menu and opening the display plug) so presumably is down to switchboard code.

remalhaut commented 3 years ago

On it, thanks for your help!