Developer Guide
Development guidelines and compilation instructions for contributors and maintainers of FJ Flow.
Developer Guide
Development guidelines and compilation instructions for contributors and maintainers of FJ Flow.
Development Prerequisites
- Language: AutoHotkey v2 (v2.0 or higher recommended)
- OS: Windows 10 / 11
Project Structure
- fjFlow.ahk: Entry point for the Pro Edition. Handles configurations, custom GUIs, and JSON operations.
- fjFlowFree.ahk: Entry point for the Free Edition. Operates on internal default maps (
KeyExtMap) without writing local files. - lib/: Internal scripts, helper classes, and libraries.
- docs/images/: Image assets used in documentation and READMEs.
- docs/CaptureWorkflow.md: Automated screen capture and asset workflow guide.
- build.ps1: PowerShell script used to package the
.exereleases.
Running from Source
- Install AutoHotkey v2 on your Windows system.
- Clone this repository.
- Double-click
fjFlow.ahk(Pro) orfjFlowFree.ahk(Free) to run.
Compiling (Building Executables)
To package the scripts into standalone .exe files, use the included PowerShell script.
Steps to Build
- Open PowerShell and navigate to the repository root.
- Run the build script:
.\build.ps1[!IMPORTANT] Running
build.ps1uses the AutoHotkey compiler (Ahk2Exe) to output the standalone executables (fjFlow.exeandfjFlowFree.exe) into thebuilddirectory.
Important Development Conventions
When editing source code or submitting pull requests, follow these implementation rules:
1. Keyboard Layout (US/JIS) Detection
- Do not use the
GetKeyboardTypeAPI to determine logical layout types. To handle setups where layouts are dynamically toggled in Windows settings, retrieve active HKL states usingGetForegroundWindowand fall back toSystemParametersInfo(SPI_GETDEFAULTINPUTLANG)for default input language lookups.
2. Layered Window (WS_EX_LAYERED) Initialization Bug
- Layered windows with style
WS_EX_LAYEREDmay fail to render on the firstUpdateLayeredWindowcall if they have never been initialized. To prevent this Windows bug, the GUI handles a dummy launch (Show("NA x0 y0 w1 h1")thenHide()) on startup to register the window buffers properly. Do not remove this initialization logic.
3. Key Hooks & Modifier Restorations
- When sending key events while key blocking (
InputHook) is active, useSendEventrather thanSendInputto prevent modifier state restoration conflicts. Always declareSetKeyDelay(-1, -1)and temporarily halt (Stop()) the hook before sending keystrokes, resuming it with a delay (Sleep(50)) afterward.
4. Git Controls
- Running git operations that require authentication (e.g.
git push,git pull) inside non-interactive shells will cause processes to hang indefinitely due to credential prompts. Restrict automated tasks to local commits, prompting the user to execute pushes manually in their terminal.