about hotkey and keys.json

Post Reply
SamC
Posts: 207
Joined: 12.08.2023 00:49

about hotkey and keys.json

Post by SamC »

Hello,
About the hotkey,When making plugin,we assign the lexers
[item1]
section=events
events=on_complete,on_goto_def,on_func_hint,on_open~,on_tab_change~
lexers=Python
Thus,the plugin should only be available in that lexers.
1.Could we use same hotkey for different lexers for different operation?
2.When set hotkey,there is an option "for current lexer",what's that mean?THe lexer " lexers=Python" will be replaced?
20230821193819.jpg
3.In cuda/settings,we have key.json and keys-lexer Python.json,what's the relation of these keys in two files?
4.I also see lexer-Python.json in settings folder,but it's empty,why?
Thanks a lot!
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

1. no, hotkey cannot point to 2 actions.
2. option "for current lexer",what's that mean --> if active ui-tab has lexer LLL, write to config 'keys lexer LLL.json' instead of 'keys.json'.

3. if ui-tab has lexer LLL, then app first reads layer 'keys.json', then it reads next layer 'keys lexer LLL.json'.
4. if file is empty, you may delete it. seems you called menuitem to edit lexer-specific config?
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

1. Could we use same hotkey for different lexers for different operation?---> ops, we can. if we write this same hotkey to lexer-specific configs 'keys lexer AAA.json' and 'keys lexer BBB.json'.
SamC
Posts: 207
Joined: 12.08.2023 00:49

Post by SamC »

main Alexey wrote:1. Could we use same hotkey for different lexers for different operation?---> ops, we can. if we write this same hotkey to lexer-specific configs 'keys lexer AAA.json' and 'keys lexer BBB.json'.
The key.json are used for all lexers and will be searched first? And in this case, we should delete the hotkey in key.json first, and then write same hotkey to lexer-specific configs 'keys lexer AAA.json' and 'keys lexer BBB.json'?
Even if we assign certain lexer in install.inf,it can be used for other lexers?
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

we should delete the hotkey in key.json first, and then write same hotkey to...
Yes
Even if we assign certain lexer in install.inf,it can be used for other lexers?
install.inf can be used for other lexers too (if I got the question).
Post Reply