Readable hotkey labels

Propose new features and changes
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Readable hotkey labels

13 Oct 2013, 06:18

I played with some guinea pigs (kids and children), they want (think) a hotkey label more elegant like:

Code: Select all

{ctrl}{alt}{n}::
{ctrl}{alt}n::
{Lctrl}{Lalt}n::
In other word, a readbale hotkey label that can have same form that what we can send with send command, and more easy than #!^+, more logic with what we see with other input
{[...]}:: doesn't seems so hard for the lexer ? Also add the "Down" for consistence with Up (but optional).
For example a {ctrl}{Lalt}{n up}:: hotkey label is very pure and understandable and will easily trigger by the hook with condition "(Lctrl|Rctrl) && (Lalt) && (n_Up)"
Will be a good gift to noob, sincerely. I don't like to have two ways to write a code but I think it is more intelligent than the actual solution.

Other thing, we already have an half solve, but it is not logic because that work for only two keys, syntax are different , no {} , and && must be prefer to & for add conditional things (hold v2 logic), so a bad sample:

Code: Select all

LCtrl & LAlt & n up::
msgbox % a_thishotkey
return
added code type ~tank
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: Readable hotkey labels

13 Oct 2013, 06:28

For Send, {ctrl}{alt}{n} is equivalent to {ctrl down}{ctrl up}{alt down}{alt up}{n down}{n up}. That is not consistent with how a hotkey is triggered. Send also has a lot more flexibility than the hotkey recognizer. Using Send syntax for hotkeys might imply that hotkeys have that flexibility, which wouldn't actually be the case.

More flexibility would be welcome, but would be far from simple to implement. The current hotkey recognizer is already fairly complex.
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: Readable hotkey labels

13 Oct 2013, 06:41

Yeah I tried to understand source, too much comments, I gave up because of my current skills...
I don't say that it is equivalent but consistent, {ctrl}{alt}{n} have to meet condition {ctrl down}{alt down}{n down} when down := {downed but not up already} and that how ahk hook work or I don't understood. In brief, kids wanted condition_form:: send same_syntax_xor_mindset_form
Anyway, we can still replace "&" by "&&" and accept 3 keys ?
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: Readable hotkey labels

14 Oct 2013, 02:47

Zelio wrote:I don't say that it is equivalent but consistent,
It's neither. Under your proposal, {key} would mean one thing with Send and a different thing with hotkeys. That is inconsistent. This is particularly a problem because users would expect Send {ctrl}{key} to trigger the {ctrl}{key}:: hotkey, but it wouldn't work that way.
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
Contact:

Re: Readable hotkey labels

14 Oct 2013, 03:06

Is this intuitive?

Code: Select all

hotkey Ctrl+X {
	; code to run
}
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: Readable hotkey labels

14 Oct 2013, 06:48

Yes coco, why not a function/class form (but less intuitive than label), however dunno about the char "+" and it is very far of features we already have.
Nevermind about consistent word, barrier language, we will not start a war for this, it was just thoughts...
Maybe more easy to change lexer to accept && and maybe accept 3 keys is not hard to change, Ctrl && LAlt && n up::, do as you wish...
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: Readable hotkey labels

15 Oct 2013, 03:50

Maybe more easy to change lexer to accept &&
Sure, but there's no good reason to && over &.
and maybe accept 3 keys is not hard to change
As I said,
More flexibility would be welcome, but would be far from simple to implement. The current hotkey recognizer is already fairly complex.
Wade Hatler
Posts: 60
Joined: 03 Oct 2013, 19:49
Location: Seattle Area
Contact:

Re: Readable hotkey labels

15 Oct 2013, 21:33

FWIW I've used tools with a more readable syntax. Vocala uses something like Ctrl+Alt+X in their equivalent of Send and I liked it half the time and hated it the rest. It is easier to read, and not much harder to type so on balance I think I'd like it, but it's pretty low on my priority list.

I run most of my AHK code through a preprocess or so I may play around with that and see how it looks. It's pretty easy to do in the pp. Just a couple RegexReplaces. It would probably be a lot more newbie friendly than the current syntax. If I do it, I'll post a couple samples.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 8 guests