feat(dbus):add getAllHotkeys dbus interface#1394
Conversation
80e0230 to
8fc4d86
Compare
|
I'd rather this is implemented with multiple existing dbus call and filter on dbus client side. |
|
If you insist on having a dbus call, you can implement in a separate (dbus) addon, instead of being an addition to this dbus addon. Some example: The reason is I find this request is too specific and is tightly couple with whatever use case you have. It's useful, but not generally useful. If you find you have some other filtering request, you have to introduce something new. Instead, filter on cilent side is very flexible and you'll have much more freedom. I believe performance won't be a concern here, if it is indeed too slow, you can still do it with your own addon. |
|
Thank you for the suggestions. Below are the reasons for submitting this pull request: Background: Using the UKUI-style input method configuration tool, there is currently no shortcut conflict detection. Implementing this functionality is required. Current Problem: Although Fcitx5's DBus interface can retrieve the global configuration and individual input method configurations, the following issues exist: After obtaining the configuration information, the contained shortcut keys need to be extracted. Retrieving the input method configurations requires multiple calls to the GetConfig method. To get the global shortcut configuration: To get input method shortcut configurations: If there are 5 input methods in the current list, at least 7 interface calls are needed: Therefore, a new getAllHotkeys method has been added to retrieve all shortcut information at once, enabling conflict detection and warnings through this data. And I'll take a look at the example you mentioned above. |
|
Hint: you can always use Chinese. The conflict detection, while useful, is a tricky thing to do. Whether a key can be triggered depending on the current context/state. Blindly do such extraction would only give you false result. For example, table addon and table's input method config contains both hotkey configuration. To really solve this in a correct way would require define some new API to manage the hotkey and their corresponding scope. like a new class maybe called HotkeyManager or sth, and let every addon to subscribe a scope handle to allow detect conflicts for individual key. |
|
抱歉刚看到回复,我会按您的建议再重新考虑下对应的场景~ |
The getAllHotkeys DBus interface returns information about global hotkeys and all hotkeys in the current input method group
The return value parameters include: category, name, unique name, description, and hotkey list