Helium314 / HeliBoard

Customizable and privacy-conscious open-source keyboard
Apache License 2.0
1.83k stars 67 forks source link

Switch language jumps to another input method #897

Closed keyboard-junkie closed 4 days ago

keyboard-junkie commented 1 week ago

Describe the bug

Switch language jumps to another input method (keyboard), even if "Language switch key behavior" is set to “Switch language“.

Note, this happens only when there is set only one language – if keyboard is using two languages, it works correctly.

To Reproduce

  1. Go to Settings > Languages & Layouts and set there only one language.
  2. Use functional key to Switch language

Expected behavior

If single language is set and if "Language switch key behavior" is set to “Switch language“ and functional key to switch language is used, then then it should do nothing.

Maybe switch language key should not be available if keyboard is using only one language, or there should be setting to disable this key.

App version

Version 2.0-beta2 (2002)

Device:

Charles7z commented 1 week ago

I think this is what you call a graceful fallback.

From the developer view why would anyone be using the language key when they have only one language set? They wouldn't therefore fallback to switch input.

keyboard-junkie commented 1 week ago

The reason is simple :), I was using "switch language" shortcut in openboard as "do nothing" when I pressed "," key longer by accident and didn't want to initiate any of the subsequent actions, which will require another actions to close/quit them (one-hand control, clipboard, settings).

Similar situations could be avoided by allowing user to choose which shortcuts to use (if any) as requested in #383.

Charles7z commented 1 week ago

Can't you add a comma to that key in the pop-up? Then you'll get a comma no matter what? 🤷‍♂️

Sorry, just read the other issue. I was able to change the return key. I think there is still some work being done on the function keys but I'm not certain.

keyboard-junkie commented 1 week ago

Can't you add a comma to that key in the pop-up? Then you'll get a comma no matter what? 🤷‍♂️

Not sure if I understand, but it is not possible to go back from pop-up to original key – the only option is to choose one of the shortcuts in pop-up or move finger further to other keys ouside of the pop-up.

I will leave it here as is – developers can decide whether switch language should fallback to switch input method or it should do nothing (both make sense).

devycarol commented 6 days ago

If you want dead space on your keyboard, that'd be a feature request to bring they back the possibility of key padding and spacers (like in a split keyboard), which I'd support.

keyboard-junkie commented 6 days ago

Agree, that it could be a feature request on its own, but it's not deal breaker for me.

I've just wanted to point on inconsistency with new setting "Language switch key behavior":

when "Switch language" option is set and it's actual behavior more describes the other options (even though it behaves like that only in special case when single language is used).

I want to stress out, that this is not about how I discovered this bug, but more about that the behavior does not align with the actual setting (at least from my point of view according to the text labels of the options), so if maintainers of this project also find this as incorrect event handling, they can fix it for the next release as this is still new feature of the pre-release.

I also undertand that this issue has low priority in contrast to other issues, but I felt obligated at least to report this, so maintainers can take an action (whatever it would be).

Helium314 commented 4 days ago

If you want a key to do nothing, you can use the label / text combination and provide an empty text, e.g. "label": "a|" will show a but do nothing. Or you can add a key with "type": "placeholder" and add some width (width is necessary due to a bug).

Anyway, the behavior should be as described. So now the language switch key is not shown if no switch can be done. If the user forces a language switch key in a custom layout, it will do nothing when it can't switch according to the setting.