mike-fabian / ibus-typing-booster

ibus-typing-booster is a completion input method for faster typing
https://mike-fabian.github.io/ibus-typing-booster/
Other
232 stars 16 forks source link

[ENHANCEMENT] there should be an extra option to lock numerals to western script #445

Closed mike-fabian closed 1 year ago

mike-fabian commented 1 year ago

See also:

https://github.com/ibus/ibus/issues/2530

Moved here because this is not an ibus problem but it could be improved by adding an option to ibus-typing-booster.

See this comment

https://github.com/ibus/ibus/issues/2530#issuecomment-1599088492

for ideas how to solve this.

mike-fabian commented 1 year ago

@itt533

Video showing the new option:

https://github.com/mike-fabian/ibus-typing-booster/assets/2330175/7b8394b3-caf9-4f00-8d2e-397646258e37

mike-fabian commented 1 year ago

@itt533

The code used in the above video is in this branch:

https://github.com/mike-fabian/ibus-typing-booster/tree/release-candidate-2.22.6

I have build packages for Fedora from this branch, they are available for testing here:

https://copr.fedorainfracloud.org/coprs/mfabian/ibus-typing-booster/builds/

As you are using slackware, you cannot use these packages, but you can clone this git repository, checkout the release-candidate-2.22.6 branch and build from source.

Instructions for how to build from source are here:

https://mike-fabian.github.io/ibus-typing-booster/docs/dev/

Please feel free to ask if you need help building and installing.

mike-fabian commented 1 year ago

I made another update adding a command which can be bound to a key to toggle the new “☑️ Convert language specific digits to ASCII digits” option with a keyboard shortcut. The update is in this branch:

https://github.com/mike-fabian/ibus-typing-booster/tree/release-candidate-2.22.7

And Fedora packages are here: https://copr.fedorainfracloud.org/coprs/mfabian/ibus-typing-booster/builds/

Screenshot showing the new key binding:

Screenshot

In the screenshot I have bound the command toggle_ascii_digits to the End key. By default, the command toggle_ascii_digits is not bound to any key.

mike-fabian commented 1 year ago

@itt533 Please test!

itt533 commented 1 year ago

i built successfully 2.22.6 earlier but i was not able to run it. I couldn't see any other executable than emoji-picker. I have to go through the docs, it will take me some time. Initially i though ibus-typing-booster is a sort of add-on to ibus. But it seems not.

mike-fabian commented 1 year ago

i built successfully 2.22.6 earlier but i was not able to run it. I couldn't see any other executable than emoji-picker. I have to go through the docs, it will take me some time. Initially i though ibus-typing-booster is a sort of add-on to ibus. But it seems not.

Apparently you used ibus-m17n before to use te-inscript or te-itrans. You add ibus-typing-booster to your desktop in a very similar way like you must have done for ibus-m17n.

Here is the documentation how to add it to your desktop:

https://mike-fabian.github.io/ibus-typing-booster/docs/user/#1

mike-fabian commented 1 year ago

As you are using XFCE, this chapter of the documentation shows you how to add ibus-typing-booster to your desktop:

When using other desktops than Gnome3: https://mike-fabian.github.io/ibus-typing-booster/docs/user/#1_3

itt533 commented 1 year ago

nice, it was actually straight forward. Your option to convert digits to ASCII digits works well, as in your screencast. I have not yet tested version 2.22.7. ibus-typing-booster has its own list of input method that users have to fill but i have not found the keyboard shortcut to select it on the fly. Why does not it honour ibus?

mike-fabian commented 1 year ago

nice, it was actually straight forward. Your option to convert digits to ASCII digits works well, as in your screencast. I have not yet tested version 2.22.7.

Great, I'll make a new release soon then.

mike-fabian commented 1 year ago

ibus-typing-booster has its own list of input method that users have to fill but i have not found the keyboard shortcut to select it on the fly.

If you setup more than one input method, you can switch to the next one with Control+Down and to the previous one with Control+Up. You can configure these key bindings, see this screenshot of the setup tool:

Screenshot

mike-fabian commented 1 year ago

ibus-typing-booster has its own list of input method that users have to fill but i have not found the keyboard shortcut to select it on the fly.

Why does not it honour ibus?

The input methods ibus-typing-booster supports are the same as ibus-m17n supports. These are all the input methods from the m17n-db package:

https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/MIM?id=3aca999e2f476cd6a1c257571a4fcdbe8bb3e02f

In case of ibus-m17n, each of these m17n-db input methods is a different ibus engine, one can use only one of them at a time. However, ibus-typing-booster is multilingual and can use up to 10 m17n-db input methods and up to 10 hunspell dictionaries at the same time.

When ibus-typing-booster is used for the first time, the default input methods and dictionaries are choosen from the locale the user is running in according to this table:

https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/itb_util.py#L247

For example, in case you were running in te_IN.UTF-8 locale, you should have gotten this default:

https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/itb_util.py#L523

'te': {'inputmethods': ['te-inscript2', 'NoIME'],
           'dictionaries': ['te_IN', 'en_GB']}

I.e. the te-inscript2 input method for Telugu plus direct keyboard input for English as the default input methods and a Telugu and a Britisch English dictionary as default.

It is hard to know what the user wants, there are so many possibilities which input methods and dictionaries might be useful. Therefore I just have this table for defaults for each locale and if that does not give what the user wants, the user has to change it.

Instead of looking only at the locale I could check which engines ibus has preloaded. Like this:

$ gsettings get org.freedesktop.ibus.general preload-engines ['anthy', 'kkc', 'xkb:us:intl:eng', 'xkb:mike::eng', 'table:wubi-jidian86', 'hangul', 'libpinyin', 'typing-booster', 'xkb:us:euro:eng', 'xkb:de::deu', 'table:cangjie5', 'OpenBangla', 'xkb:us:altgr-intl:eng', 'm17n:t:latn-post', 'm17n:t:latn-pre', 'm17n:t:latn1-pre', 'm17n:t:math-latex', 'table:hu-old-hungarian-rovas', 'm17n:hu:rovas-post', 'm17n:ru:translit', 'table:translit']

All the engines whose names start with m17n: are engines from m17n-db. In my example above

'm17n:t:latn-post', 'm17n:t:latn-pre', 'm17n:t:latn1-pre', 'm17n:t:math-latex', 'm17n:hu:rovas-post', 'm17n:ru:translit'

Maybe it would be an improvement if I get the default setup when ibus-typing-booster is started for the very first time not only from the current locale but on top of that add also all m17n input methods which are already preloaded by ibus. That might make it easier for a previous user of ibus-m17n when using ibus-typing-booster for the first time because he would get all ibus-m17n input methods he used before configured in ibus-typing-booster by default (Up to 10). It would still be difficult to decide which one of these should get the top priority.

I am not sure whether this is worth the effort, I think getting the default from the current locale is good enough.

mike-fabian commented 1 year ago

ibus-typing-booster is multilingual and can use up to 10 m17n-db input methods and up to 10 hunspell dictionaries at the same time.

Some documentation about multilingual input:

https://mike-fabian.github.io/ibus-typing-booster/docs/user/#4

Example using Hindi and English at the same time:

https://mike-fabian.github.io/ibus-typing-booster/docs/user/#4

Sometimes this multilingual feature can help to save some keystrokes by not having to switch input methods, if Hindi is at the top priority and you want to type an English word, it may be faster to just type and select the completed English word from the candidates popping up than to switch to the English input method and back to Hindi.

mike-fabian commented 1 year ago

New option is in ibus-typing-booster-2.23.0: https://github.com/mike-fabian/ibus-typing-booster/releases/tag/2.23.0