I understand that there's an implicit parameter 'ThisHotKey' that exists on entry to every hotkey routine. Quite often I'm wanting just the key name(s)
from this parameter without the modifiers. So, for example, if ThisHotKey = "$!+LButton" then I often want just "LButton" to use in a command
like " keywait 'LButton' ". If it was a double hotkey like "~RButton & C" then I'd want just 'RButton' and 'C'.
I realise that it's a fairly trivial task to strip these modifiers out, but I was wondering if it would make any sense to have some other
parameter(s) that contain just the key name(s)?
Discuss the future of the AutoHotkey language
3 posts • Page 1 of 1
I don't think it makes sense to add this as a parameter. It would make more sense to change the current parameter to be the hotkey object itself, which could have the desired information accessible through a property. I don't think that is a priority though.
I think you can achieve that with a simple instr() like so:
Code: Select all
if instr(ThisHotkey, "LButton") if (instr(ThisHotkey, "RButton") && instr(ThisHotkey, "C")) ; check for 2 keys
Who is online
Users browsing this forum: No registered users and 3 guests