This page summarizes the script-visible changes in recent Keysharp releases, so that a script written against an earlier version can be brought up to date. The release page holds the authoritative notes and the downloads for each version.
Note: Keysharp has not reached version 1.0. Behavior can change between releases, including in ways which require edits to existing scripts. Each release below lists its breaking changes first.
| Property | Value |
|---|---|
| Keysharp version described here | 0.0.0.17 |
| AutoHotkey compatibility target | v2.1-alpha.33 |
See Changes from AutoHotkey to Keysharp for the differences, Platform Support for per-platform availability, and the platform remarks on each affected reference page.
The corresponding upstream language changes are described in Changes from v2.0 to v2.1.
Compatibility target: AutoHotkey v2.1-alpha.33.
VarSetStrCapacity(&Var, -1) or when it is next passed as Str; unlike AutoHotkey, a write preserving the length is not immediately visible. A literal's pointer remains valid while the string exists. ObjFree was removed.ObjPtr(Obj).Ptr becomes ObjPtr(Obj). Keep the object alive while using the address. Use ObjPtrAddRef and a matching ObjRelease when a separately counted COM reference is needed."ANSI" was removed. Use a Buffer with StrGet(Buf, "CP0") for ANSI output. Capacity is the requested character count, without the former extra character.&x == &x is true. Output and ByRef parameters require a VarRef or virtual reference; ordinary objects cannot receive them.ToString; Map.ToString uses square brackets.0 explicitly for zero-filled memory. Image.GetPixelData defaults to 4 bytes per pixel (RGBA); pass 1 for grayscale. Crypt string input defaults to UTF-8 instead of UTF-16.0.1 displays as 0.10000000000000001. InStr and StrReplace use Unicode ordinal case folding for both Off and Locale.true second. ExitCode and ExitTime are empty while the child is running.ParseScript(Code) became ValidateScript(Code) for syntax checks or CompileScript(Code) for compilation. Test Result.IsValid; diagnostics are in Result.Errors and Result.Warnings.SetTimer("MyFunc") becomes SetTimer(MyFunc). Use ObjBindMethod instead of Func(Name, Obj). GUI event sinks still accept method names. CallbackCreate returns an Integer address: cb.Ptr becomes cb, also passed to CallbackFree.0, stops later handlers. OnMessage can also claim a message by returning 0.#Import Ks { App, A_PeekFrequency }, or import Ks and qualify them. Module objects expose their own and imported names; use Other.%Name% instead of Other[Name]. Standalone and default exports were removed; modules export their globals, functions and classes.#Assembly* and #HookMutexName became keys of #App. Assembly metadata is available through App; missing metadata attributes return empty strings. App.Name always reports the running assembly's identity, including when Name was not declared.WinEvent.Active(Callback, WinTitle) becomes Hook := WinEvent(WinTitle), Hook.OnActive := Callback, Hook.Start(). Count and EventType were removed; stop the hook in the callback when appropriate, and identify the event by its callback slot.{X, Y, Width, Height} for move/caret events; use the callback's Time parameter for the event time.Await(worker.Terminated) for thread completion or Await(worker.Task) for its result. Replace ContinueWith with worker.Task.Then(v => RealThread(Callback, Arguments*)) for a worker continuation; errors are delivered through Task. Exit takes only ExitCode; use a Thread object to end another thread.{Width, Height} and {X, Y}. Overlay/Highlight.W and H became Width and Height; Visible became IsVisible; RequestCapabilities.Granted became IsGranted.(Hook, DX, DY). Ending input discards queued character/key/mouse notifications; OnEnd still runs. BeforeHotkeys cannot change while input is running.ComValue(0xB, Value) for a COM boolean. Type information can still trigger automatic conversion.*DirTopRight instead of digits. File.RawWrite and FileAppend RAW write string UTF-16 bytes; File.Seek returns 1/0. Built-in parameter names were corrected for named arguments.ahk_group. WinWait functions and StatusBarWait check once for Timeout 0. ProcessWaitClose returns 0 when all matches have closed.Other removed or renamed extensions:
| Previous API | Replacement |
|---|---|
| ObjHasProp; Obj.OwnPropCount; Ks.Join | HasProp (also checks primitive prototypes); ObjOwnPropCount; Array.Join |
| Array/Map.MaxIndex and MinIndex | Removed; ComObjArray is unaffected. |
| A_IsPersistent; A_AllowTimers; A_ThreadId | A_Persistent; A_Thread.AllowTimers; A_Thread.Id |
| A_InputLevel; A_SuspendExempt | Removed. Configure input levels with #InputLevel, Hotkey's In option or the hotstring In option; use #SuspendExempt for exemption. |
| A_Asm*; A_CommandLine; A_HasExited | App metadata; App.CommandLine; App.ExitReason != "" |
| A_KeysharpPath; A_AhkBuildVersion | A_AhkPath; use Ks.A_KsVersion for the engine version or App.Version for the application version. |
| A_IsUnicode; A_Priority; A_UseHook; A_LoopKey; A_LoopFileLongPath | Removed. Use the for-loop's key variable and A_LoopFileFullPath where applicable. |
| A_WorkAreaWidth/Height; A_TotalScreenWidth/Height; A_ScreenScale | Monitor.Primary.WorkArea.Width/Height; Monitor.VirtualScreen.Width/Height; Monitor.Primary.Scale |
| FileDirName; WinMaximizeAll | SplitPath (resolve relative paths first); WinMaximize each result of WinGetList. |
| AES; CRC32; MD5; SHA1/256/384/512; SecureRandom | Crypt.Encrypt/Decrypt, CRC32, Hash and SecureRandom. |
| CopyImageToClipboard; IsClipboardEmpty | Clipboard.Image; Clipboard.IsEmpty |
| MonitorFromPoint; MonitorGetScale | Monitor.FromPoint; Monitor.Scale |
| Ks.JsonEncode/JsonDecode; Base64Encode/Base64Decode | Json.Encode/Decode; Base64.Encode/Decode. JSON null decodes to unset unless NullValue supplies a replacement; assigning unset to a Map element deletes its key. |
| Buffer.ToHex/ToBase64/ToByteArray | Hex.Encode; Base64.Encode; pass Buffer directly where .NET expects byte[]. |
| Array.MapTo; Ks.NormalizeEol | Array.Map; Ks.ReplaceLineEndings |
| FuncObj; InputObject; ProcessInfo; RegExMatchInfoCs | Func; InputHook; ScriptProcess; RegExMatchInfo. Regex Success was removed; a Cs miss stores an empty value, and Count excludes the overall match. |
| LockRun(LockObject, Callback, Arguments*) | Lock.Acquire/Release; only Lock objects can be locked. |
#Hotstring I1 or Hotstring("I1"). An explicit hotstring default takes precedence over the #InputLevel fallback.DesktopEntry and embedded files; App reports metadata, command line and exit status. #TrayIcon embeds a startup icon, and FileInstall extracts embedded files.keysharp --kpm. --compile asm compiles several scripts to separate .cks files. The parser and compiler are optional deployment components, so compiled scripts can run with the runtime alone; IsComponentAvailable checks their availability.Compatibility and correctness fixes cover parsing, imports and closures, numeric/string operations, regex options and callouts, errors, callbacks, input, timers, window/control operations, COM by-reference VARIANT writes, file/registry operations and native memory. GUI automatic sizing, Edit resizing, RichEdit text casing, exact image copies, and Linux/macOS list/tree controls, InputBox, menus and coordinates are corrected. macOS GUIs accept the first click and use window-server handles; BlockInput blocks requested mouse movement in foreign applications, and Keyview pastes plain text. Hotstrings recognize abbreviations of any length and punctuation boundaries on Linux/macOS. Linux native-state queries and Wayland window/overlay updates are refreshed. Logical comparison is portable. Parsing, object/collection access, window/control searches, hotstring matching, COM calls and file loops are faster; native-resource cleanup, compiler-daemon recovery and interruptible waits are improved. See Platform Support for backend limits.
Released 2 August 2026.
ImageCapture() was removed. Use the Image class instead.A_ScaledScreenDPI was renamed to A_ScreenScale.WINDOWS, OSX or LINUX.ImageCapture().Highlight and ToolTip on Linux and macOS.Active, Exist, NotExist, Move, Minimize, Restore and TitleChange.MonitorGetScale and MonitorFromPoint in the KS module.*Dir scan-direction option for ImageSearch.OCR.ks) with a pluggable engine, and demo scripts including ClipboardHistory, InputHUD, OCRSnip, Shell, WindowGrab and WindowTiler.Release-mode stack traces for C# exceptions, OnExit teardown, script exit when the last window closes, thread priority handling and DLL path normalization. Parser fixes for #Include, static variables, dereferences and remap syntax. Regular-expression pattern caching, font caching, cheaper per-call thread setup and faster keyboard-layout queries.
Released 22 June 2026. This release made Keysharp cross-platform across Windows, Linux and macOS.
inputd input daemon, .deb packaging with automatic .NET 10 installation, Unicode character sending and Keyview syntax highlighting.Notes for 0.0.0.14 and earlier are on the release page. For changes which have not yet been released, see the source history; documentation changes are tracked in the KeysharpDocs history.
The original AutoHotkey change log is retained as an archived upstream reference. Its entries describe releases of AutoHotkey, not of Keysharp.