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

How to change key bindings? #57

Closed
Joe-C-Ding opened this issue Jan 16, 2019 · 12 comments
Closed

How to change key bindings? #57

Joe-C-Ding opened this issue Jan 16, 2019 · 12 comments

Comments

@Joe-C-Ding
Copy link

Joe-C-Ding commented Jan 16, 2019

By reading tables/template.txt, it seems that the key bindings are come with the whole table definitions. I'm using wubi-table, and feel good with the table itself. is there a way to change the key bingdings without re-defined the whole table? Or can I generate something like template.txt from a .db file?

preticuarly, I wish to use ; and ' to select the 2nd and 3rd candidates. I think a lots of wubi-users are familiar with those keys too.

@mike-fabian
Copy link
Collaborator

It is unfortunately hardcoded at the moment, but I hope I can find time to make that configurable soon.

@Joe-C-Ding
Copy link
Author

I've tried to generate my own .db file based on this file, but without success.

In detail, I put
SELECT_KEYS = 1,;,',4,5,6,7,8,9
just before
END_DEFINITION,

and then execute:

$ /usr/bin/ibus-table-createdb -n wubi86.db -s wubi86.txt
$ sudo cp wubi86.db /usr/share/ibus-table/tables/
$ ibus restart

If I input a , for example, with this new wubi86.db, the candidates list is something looks like

a (1 / 9)
1. 工
0xfffffff. 区 qi
0xfffffff. 或 kg
4. 或 kgd
...

neither 2/3 nor ;/' can be used to choose the 2nd/3rd candidate. If I did something wrong? Or are there any other restrictions on the configuration?

@mike-fabian
Copy link
Collaborator

In https://github.com/mike-fabian/ibus-table/releases/tag/1.11.0 this should be possible now without changing the table source.

See the explanation in this comment how you can change the keybindings using the command line:

ibus/ibus#2241 (comment)

@mike-fabian
Copy link
Collaborator

mike-fabian commented Aug 18, 2020

When using ibus-table 1.11.0 https://github.com/mike-fabian/ibus-table/releases/tag/1.11.0 you can
change the user keybindings for committing the second and third candidate like this:

$ dconf write /org/freedesktop/ibus/engine/table/wubi-jidian86/keybindings "{'commit_candidate_2': <['2', 'KP_2', 'semicolon']>, 'commit_candidate_3': <['3', 'KP_3', 'apostrophe']>}"

This does what you want.

It is not convenient though.

I will rewrite the setup tool soon so that one can do that conveniently with the graphical user interface.

@mike-fabian
Copy link
Collaborator

In detail, I put
SELECT_KEYS = 1,;,',4,5,6,7,8,9
just before
END_DEFINITION,

...

neither 2/3 nor ;/' can be used to choose the 2nd/3rd candidate. If I did something wrong? Or are there any other restrictions on the configuration?

SELECT_KEYS = 1,semicolon,apostrophe,4,5,6,7,8,9,0

should work.

But now you don’t need to change the table source anymore.

I think it is easier to update to ibus-table 1.11.0 and change the user settings as I explained in my last comment.

@mike-fabian
Copy link
Collaborator

And, if you use

SELECT_KEYS = 1,semicolon,apostrophe,4,5,6,7,8,9,0

in the table source, you lose the ability to commit the second candidate with 2 and the third candidate with 3.

When using ibus-table 1.11.0 the user setting for the command commit_candidate_2 can be a list of keys, so as in my example above, it is possible to use 2, keypad 2, and ; at the same time.

@Joe-C-Ding
Copy link
Author

Wow, that's a good news!

@mike-fabian
Copy link
Collaborator

I am almost finished rewriting the setup tool:

Screenshot

@mike-fabian
Copy link
Collaborator

In the setup shown, semicolon, 2, and KP_2 all commit the second candidate.

If there is more than one keybinding configured to commit a candidate, only the first one is shown in the lookup table.

As I did use ['semicolon', '2', 'KP_2'], the semicolon is the first and therefore one can see it in the lookup table before the second candidate. When using the setting ['2', 'KP_2', 'semicolon'] one would see 2 in front of the second candidate.

@mike-fabian
Copy link
Collaborator

Will be in the next release.

@mike-fabian
Copy link
Collaborator

It is in ibus-table 1.12.0:

https://github.com/mike-fabian/ibus-table/releases/tag/1.12.0

@mike-fabian
Copy link
Collaborator

In 1.12.1, I added buttons to easily change the order of key bindings for a certain command:

https://github.com/mike-fabian/ibus-table/releases/tag/1.12.1

If there is more than one keybinding configured to commit a candidate, only the first one is shown in the lookup table.

In 1.12.0, if one wanted a certain key binding to show up first, one had to remove all key bindings for that command and add them again in the desired order. Now there are buttons to change the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants