Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 218 additions & 8 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ All prediction happens in pure Rust. Zero network. Zero cloud. Sub-millisecond p

### Windows pilot status

The Windows package is an **experimental pre-release pilot**, not a daily-ready input method. A future pilot must use a disposable, non-elevated Windows account and pass the separately gated registration, clean-uninstall, and native-app checks; packaging alone does not establish those results or fix the known ReplaceWord/composing defects. Its runtime payload is limited to the helper, DLL, reviewed public corpora, and starter configuration; the archive also carries the pilot safety form and repository license notices. Copying data to `%APPDATA%\smartkey` and any later registration are manual, separately authorized actions: the package creates no autostart, sends no network traffic, and excludes `personal.json` and private corpora.
The Windows standalone package is an **experimental pre-release candidate**, not a daily-ready input method. An administrator explicitly installs the shared COM/TSF service once; the intended user then installs, enables, disables or removes their own setup without elevation. User setup copies only missing public starter data and adds a reversible login entry and Start menu commands. Personal data is preserved and never packaged. See the [Windows installation and removal instructions](crates/smartkey-win/packaging/README-WINDOWS.md).

The candidate includes the shared-core changes through 31 October 2026, while retaining its Windows composition and Unicode replacement handling. Native Windows CI checks the frozen payload, elevated machine setup/removal, and maintenance under an actual nonadministrator account. Those checks establish installation behavior only: interactive typing, Win+Space, real logon and application-specific behavior still require a Windows desktop pilot. A successful build alone does not establish those results.

The Rust core (`smartkey-core`) is platform-agnostic — all prediction logic and key event state machine are shared. Each platform crate is a thin adapter (~200-400 LoC) that bridges OS input events to the shared `InputMethodCore`.

Expand Down
5 changes: 5 additions & 0 deletions crates/smartkey-win/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ log = { workspace = true }
windows-core = "0.58"
windows = { version = "0.58", features = [
"Win32_UI_TextServices",
"Win32_UI_WindowsAndMessaging",
"Win32_System_Com",
"Win32_Foundation",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_System_Registry",
"Win32_System_LibraryLoader",
"Win32_UI_Shell",
"Win32_Security",
"Win32_Security_Authorization",
"Win32_Storage_FileSystem",
"implement",
] }

Expand Down
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Disable-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
set "SMARTKEY_HELPER=%~dp0smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" set "SMARTKEY_HELPER=%ProgramFiles%\SmartKey\smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" (
echo SmartKey helper is missing. Extract the whole archive, then install the machine package once.
pause
exit /b 1
)
"%SMARTKEY_HELPER%" --disable
if errorlevel 1 (
echo SmartKey could not complete the action. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Enable-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
set "SMARTKEY_HELPER=%~dp0smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" set "SMARTKEY_HELPER=%ProgramFiles%\SmartKey\smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" (
echo SmartKey helper is missing. Extract the whole archive, then install the machine package once.
pause
exit /b 1
)
"%SMARTKEY_HELPER%" --enable
if errorlevel 1 (
echo SmartKey could not complete the action. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Install-Machine-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
rem Explicit machine action. Right-click this command in the extracted archive
rem and choose Run as administrator. No automatic elevation is attempted.
if not exist "%~dp0smartkey-register.exe" (
echo Extract the whole original SmartKey archive before this machine action.
pause
exit /b 1
)
"%~dp0smartkey-register.exe" --install-machine
if errorlevel 1 (
echo Machine action was incomplete. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Install-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
set "SMARTKEY_HELPER=%~dp0smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" set "SMARTKEY_HELPER=%ProgramFiles%\SmartKey\smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" (
echo SmartKey helper is missing. Extract the whole archive, then install the machine package once.
pause
exit /b 1
)
"%SMARTKEY_HELPER%" --install
if errorlevel 1 (
echo SmartKey could not complete the action. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
82 changes: 82 additions & 0 deletions crates/smartkey-win/packaging/README-WINDOWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# SmartKey for Windows 10/11 x64

This archive contains the complete application and public starter data. No Git,
Rust, Python or Visual C++ installer is required. Extract the whole archive;
keep it available for machine removal. Source/native acceptance status is
recorded separately in the supplied manifests; actual typing still needs a
Windows desktop check.

## November refresh

This candidate incorporates the shared-core changes through 31 October 2026.
Automatic word correction remains off by default. Pending typed text is delivered
before application shortcuts, without accepting the displayed completion; the
shortcut itself is forwarded. No pause-based commit timer is introduced on Windows.
The explicit administrator installation and reversible user commands are retained.
The exact build source and file hashes are in `artifact-source-manifest.json`.

Installation tests and desktop typing are separate checks. Before relying on this
candidate, try synthetic BG/EN text, Tab acceptance, Ctrl+C/Ctrl+V after a partial
word, navigation, Win+Space and a real sign-out/sign-in in the intended applications.
Do not infer those results from the CI installation checks.

## Install once on a permitted computer

If an older SmartKey Windows version is installed, remove that version before
installing this shared machine package. If this package is already installed and
user setup reports an old per-user COM conflict, ask an administrator to review
that exact registration. Do not blindly run the legacy uninstaller at that point:
it may remove the shared TSF catalog. Setup preserves the conflict rather than
deleting an unknown registration.

An administrator is needed once to register the shared Windows text service.
Right-click **Install-Machine-SmartKey.cmd** in the extracted archive and choose
**Run as administrator**. It copies the complete bundle to the Windows Program
Files known folder, in **SmartKey**, and registers the machine COM/TSF catalog.
This phase does not enable SmartKey for the administrator, edit their AppData,
change their keyboards, or add a login entry. It refuses an existing machine
installation; remove it explicitly before replacing it.

Then close the administrator window. As the person who will type, double-click
**Install-SmartKey.cmd normally**. This enables SmartKey for that account, copies
only missing starter data to that user's **AppData\Roaming\smartkey**, verifies
it in a separate process, and adds one user login entry and Start menu commands.
Existing configuration, public corpus changes and personal files are preserved.
If machine installation is missing, this step stops with instructions before
changing user data or keyboard settings. It never triggers automatic elevation.
Each additional permitted user runs this normal step in their own account.

## Use and return to your ordinary keyboard

Press **Win+Space** and choose SmartKey. Press **Win+Space** again to select your
ordinary keyboard. Existing layouts and your default choice remain available.
Open a new text app after installation. The login entry is intended to restore
availability at the user's next Windows login; verify this in the desktop pilot.
SmartKey does not force itself to become the default keyboard.

Start menu > SmartKey provides **Status**, **Enable**, **Disable** and **Uninstall**.
Disable removes this user's SmartKey login entry. Enable restores availability
and login. Run these commands normally, without administrator elevation.

## Remove

**Uninstall-SmartKey.cmd** removes only the current user's availability, login
entry and menu commands. It preserves personal data and the shared machine files.

When no one needs the shared installation, close apps using SmartKey. Right-click
**Uninstall-Machine-SmartKey.cmd in the original extracted archive** and choose
**Run as administrator**. It removes the exact shared catalog/COM registration and
allowlisted Program Files bundle. Run it from the archive, not the installed
Program Files directory, so the running helper can delete every machine file.
Other keyboards and all users' personal data are preserved. Machine removal does
not access other users' profiles; each configured user can remove their own login
entry using Uninstall-SmartKey.cmd from the archive. Locked files or failed
registration operations produce an error and can be retried; no success is claimed
for a partial removal.

## Files and privacy

The archive contains EXE/DLL, seven visible CMD commands, two manifests, public
JSON starter data, this README and license notices. It never includes personal.json.
User data stays in the user's AppData; no network connection is needed for setup
or typing. No service, scheduled task or PowerShell policy bypass is installed.
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Status-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
set "SMARTKEY_HELPER=%~dp0smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" set "SMARTKEY_HELPER=%ProgramFiles%\SmartKey\smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" (
echo SmartKey helper is missing. Extract the whole archive, then install the machine package once.
pause
exit /b 1
)
"%SMARTKEY_HELPER%" --status
if errorlevel 1 (
echo SmartKey could not complete the action. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
16 changes: 16 additions & 0 deletions crates/smartkey-win/packaging/Uninstall-Machine-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal
rem Explicit machine action. Right-click this command in the extracted archive
rem and choose Run as administrator. No automatic elevation is attempted.
if not exist "%~dp0smartkey-register.exe" (
echo Extract the whole original SmartKey archive before this machine action.
pause
exit /b 1
)
"%~dp0smartkey-register.exe" --uninstall-machine
if errorlevel 1 (
echo Machine action was incomplete. The error window describes the failure.
pause
exit /b 1
)
exit /b 0
20 changes: 20 additions & 0 deletions crates/smartkey-win/packaging/Uninstall-SmartKey.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off
setlocal
set "SMARTKEY_HELPER=%~dp0smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" set "SMARTKEY_HELPER=%ProgramFiles%\SmartKey\smartkey-register.exe"
if not exist "%SMARTKEY_HELPER%" (
echo SmartKey helper is missing. Extract the whole archive, then install the machine package once.
pause
exit /b 1
)
"%SMARTKEY_HELPER%" --uninstall
if errorlevel 1 (
echo SmartKey could not complete the action. The error window describes the failure.
pause
exit /b 1
)
rem Remove this currently running user menu command only in the final block.
(
del /q "%APPDATA%\Microsoft\Windows\Start Menu\Programs\SmartKey\Uninstall-SmartKey.cmd" 2>nul
exit /b 0
)
Loading
Loading