AutoHotkey v2 alpha (UPDATES)

Discuss the future of the AutoHotkey language
Posts: 6668
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


09 Oct 2019, 05:52


Particularly important:

Removed the new operator; use

Changed objects to throw an exception when attempting to retrieve an undefined property.

Simplified SetTimer: removed "On"/"Off"/"Delete", the ability to disable/re-enable timers (which requires keeping them in the global timer list), and inconsistency between actual functions (Func) and function objects. Delete a timer by passing 0.

Changed hotkeys without #/! to never mask release of Win/Alt, rather than doing so only if Win/Alt is physically down (inconsistent with remapped Win/Alt keys).

Added IsSet(Var).

Added primitive types and Any to the type hierarchy. Added prototypes for Any, Primitive, String, Number, Integer and Float; not yet accessible except through a value of the applicable type. All values are based on Any (except ComObjects) and can use HasBase, HasProp, HasMethod and GetMethod, which are now also functions. Define/Delete methods can't be called directly on the prototypes as they are not derived from Object.Prototype.

Changed BoundFunc to merge parameter lists when bound args are omitted.

Changes and additions relating to DllCall (and native COM interfaces in particular):
  • Added Ptr property to VT_ARRAY, VT_BYREF and VT_UNKNOWN ComObjects, allowing them to be passed to DllCall more easily.
  • Added HRESULT return type for DllCall (throws on failure).
  • Added ComCall as a shortcut for calling COM interface methods.
  • Changed DllCall "str" to detect overwrite of null-terminator.
  • Changed Str*, WStr* and AStr* to output value of new pointer.
  • Changed DllCall Ptr*, Obj to assign to Obj.Ptr rather than Obj. This allows constructs such as DllCall(..., "Ptr*", unk :=, which reduces repetition and improves maintainability compared to DllCall(..., "Ptr*", punk), unk :=
  • Changed DllCall to throw if a numeric-type parameter is non-numeric. In particular, if the * or P suffix is used for output parameters, the output variable is required to be initialized. This improves robustness and compatibility with #Warn.
Changed internal use of Call to bypass __Call, and improved compatibility with COM function objects that handle DISPID_VALUE, such as JScript functions.

Changed FileOpen to throw an exception on failure.
Changed Object.New(with_params) to throw if there's no __New.
Changed concatenation with an object to produce an error.

Improved error-reporting for invocation of unknown property/method.

Fixed Menu prototype not inheriting from Object.Prototype.
Fixed debugger skipping enumerated items when properties are present.
Fixed For onevar in e to call e.__Enum(1) rather than e.__Enum(2).
Fixed CStringA buffers not being freed by DllCall if an exception is thrown.
Fixed handling of ComObj[] and ComObj.__Item.
Fixed incorrect error messages for x.y[z] when [z] is impossible.
Fixed issues with multiple arrow functions in the same scope.
Fixed Object() to throw when given an odd number of parameters.
Posts: 6668
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


16 Nov 2019, 20:18

Main breaking changes:
Removed support for Windows XP.
Removed the key names Return and Break.

Changed WinTitle to allow passing a HWND as an Integer or object with a HWND property. DetectHiddenWindows is ignored in such cases.

Changed GroupDeactivate to be more consistent with OS task switching, and generally handle windows which own other windows more intelligently.
Changed TrayTip to specify the current small tray icon when the NIIF_USER (0x4) flag is used, and the large icon when NIIF_LARGE_ICON (0x20) is also used.
Simplied VK/SC conversion; improved compatibility with custom layouts.
Changed the way Input handles the primary end key of VKs with two names.
Fixed GetKeyName to return non-Numpad key names when given a VK.
Fixed File.WriteXXX(n).
Simplified AltGr detection to reduce code size.
Removed obsolete remap destination exceptions and fixed x::vk13 (Pause).
Merged latest changes (90b5c2ac) from v1 branch.

Changed Group(De)Activate/Close to throw if group name is invalid.
Improved validation of function objects by various functions/methods, for early detection of errors (such as passing a function object which does not accept the right number of parameters).
Fixed objx.%objy% to throw an exception.
Posts: 6668
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos


07 Dec 2019, 17:09

Fixed InputHook.KeyOpt sometimes using vkNN behaviour for single chars.
Fixed crashes caused by manipulating InputHook properties (by lvalkov · Pull Request #153)
Merged v1.1.32.00.
Fixed omitted parameters in variadic calls to use default value.
Fixed [Array].Has(i) to return 1 rather than i when true.

Revised SoundGet/SoundSet.
  • Remove unsupported control types (everything except Volume/Mute was supported only on XP).
  • Remove legacy mixer component types.
  • Let components be referenced by name and/or index.
  • Let devices be referenced by name-prefix and/or index.
  • Split into separate Volume and Mute functions.
  • Add SoundGetName for retrieving device or component name.
  • Add SoundGetInterface for retrieving COM interfaces.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 15 guests