robertdeniro wrote:
When I pass Transparent to WinSet, is Transparent a keyword - or a string parameter?
It is a string parameter. WinSet then compares that string against several keywords.
Quote:
And sometimes when I think I've got it - a DllCall will only work with the opposite!
DllCall and all other functions() use expression rules, commands do not (except in numeric parameters).
Quote:
1) Commands as Functions
Already done:
Titan's Command Functions.
Quote:
As a side note, perhaps the pre-processor directives could also take the same form so we'd write #EscapeChar(NewChar), #SingleInstance(Value)
That is an interesting point which I had not considered. However, it would not be feasible (or practical) to support proper expression syntax in directives.
Quote:
2) Explicit Strings - Use double quotes like other languages to define a string.
It is possible to avoid "implicit string syntax" in most cases:
Quote:
Source: AutoHotkey Documentation: Variables and ExpressionsForce an expression: An expression can be used in a parameter that does not directly support it (except an OutputVar or InputVar parameter such as those of StringLen) by preceding the expression with a percent sign and a space or tab. This technique is often used to access arrays. For example:
Code:
FileAppend, % MyArray%i%, My File.txt
MsgBox % "The variable MyVar contains " . MyVar . "."
Loop % Iterations + 1
WinSet, Transparent, % X + 100
Control, Choose, % CurrentSelection - 1
Quote:
It would be very useful if the hotkey subroutine itself could decide whether to consume or pass-thru the hotkey, rather than having 2 make a choice before hand.
This would be like a hook function.
This can be done with an actual hook function or
AutoHotkey_L's #if. As with #IfWin, it requires the hotkey to be implemented using a system-wide keyboard hook. It would not be practical to allow this feature for all hotkeys, since scripts are relatively slow and likely to introduce system-wide input lag due to the nature of the keyboard hook. If a script goes awry, it can make the PC unusable (though in most configurations only for a few seconds).
Quote:
4) MouseMove as a hotkey - In other words, receive events only when the user moves the mouse.
The use of a mouse hook to detect mouse movement has been demonstrated on the forums.