Page 1 of 1

about hotkey and keys.json

Posted: 21.08.2023 11:48
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!

Posted: 21.08.2023 12:05
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?

Posted: 21.08.2023 12:12
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'.

Posted: 21.08.2023 12:55
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?

Posted: 21.08.2023 13:58
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).