Page 1 of 1
SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 08:22
by autocart
Hi all,
Is it somehow possible to get the hotkey-combo by which a script was called (if that was the case)?
I know about get("Shift") but I would like to know the whole key-combination, not just the modifier keys.
Thx in advance.
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:00
by highend
Code: Select all
$caption = "Test current script";
$commands = get("listofcommands", 2);
$ourself = regexmatches($commands, $caption . ".*");
$keyCombo = regexreplace($ourself, "^(.*\()(.*?)(\))", "$2");
$caption = Caption of the script in e.g. UDC - Load Script File - Caption
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:16
by autocart
Wow, nice, how do u even KNOW such things?
One thing, though. AFAI can see that construct does not return the info, whether the script was actually called by that hotkey (or by some other way).
Is that possible also, with some more of ur magic?
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:26
by highend
1. Get what XY makes available via scripting
2. Creative use of it (parse it)
3. Hope that Don will finally switch all config files into plain readable (non binary) files
-> More profit
If it was called: Not for scripts that didn't use a modifier, otherwise get("shift") and if one of it's values are present, the script was called via the hotkey (at least with a 99% chance)
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:35
by autocart
highend wrote:If it was called: Not for scripts that didn't use a modifier, otherwise get("shift") and if one of it's values are present, the script was called via the hotkey (at least with a 99% chance)
Mmm, thx, at least that is an idea, but for my taste a very dangerous one that I would not want to rely on. But thx anyway for the brainstorming.
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:37
by highend
Then use a background running .ahk script that checks which key was pressed and communicate with XY via WM_COPYDATA...
Re: SC: get hotkey-combo that started the script?
Posted: 12 Apr 2016 09:39
by autocart
Yes, if it is absolutely necessary then that would probably be the way to go. Thank you very much.
For now it is too much of an overhead for what I had in mind, though.