English | 中文
Repurpose the CapsLock key for switching input methods on Windows.
The name "Capsense" comes from "CapsLock" + "Sense", as in making the CapsLock key make sense by giving it a new function to enhance the input experience.
On Windows, the default shortcuts for switching input languages (such as Shift and Win + Space)
can cause confusion about the current input method status.
MacOS solves this by utilizing the often-underused CapsLock key as a dedicated toggle for input sources. Capsense
brings this behavior to Windows, allowing you to use a quick tap of the CapsLock key to trigger IME switching, while
still retaining the ability to use CapsLock for its original purpose.
- Use a short tap of
CapsLockto switch input methods. - Long press to use CapsLock for its original purpose.
- Runs efficiently in the background with minimal resource usage.
- Easily change the tap threshold and the shortcut triggered.
Simply run the executable to start monitoring CapsLock events.
Capsense is interactive by default in Explorer but headless in CLI. You can override this behavior with the command-line arguments.
We recommend setting your IMEs to disable the functionality of the Shift key for switching IME states to get the best
experience, as it can confuse you. Instead, you use CapsLock to switch keyboard layouts, Use Win+Space to switch the
primary IME of the current keyboard layout.
Run Capsense from Explorer or with --gui while an instance is already running to open
the Instance Manager, which allows you to control the running instance without using the command line.
Capsense does not require administrator privileges to run.
However, if you want to allow Capsense to switch input methods in elevated applications (running as administrator), you need to run Capsense with administrator privileges as well.
And of course, you can't control elevated Capsense itself from a non-elevated instance.
On first run, a config.toml file will be created in the same directory. You can customize the following:
tap_threshold_ms: The maximum duration (in milliseconds) for aCapsLockpress to be considered a "tap".300ms by default.tap_action: The action to perform on a tap. Supported actions are:shortcut: Trigger a keyboard shortcut (defined bytap_shortcut).switch_layout: (Default) Rotate through input layouts.
tap_shortcut: The shortcut to trigger (["LWIN", "SPACE"]by default). Supported keys are:LWIN(orWIN)SPACELCONTROL(orCTRL)LSHIFT(orSHIFT)LMENU(orALT)CAPSLOCK
layouts: A list of input layout IDs to rotate through whentap_actionis set toswitch_layout.- Default:
[0x0804, 0x0409](zh-CNanden-GB). - See Microsoft's documentation for more layout IDs. Other common ones are:
0x0404: Traditional Chinese0x0411: Japanese0x0412: Korean
- Default:
no_en: When enabled, Capsense prevent your Chinese IMEs from entering English mode after layout or focus changes.trueby default.- Idea from
mbbill/no_english_mode.
- Idea from
The program supports the following command-line arguments:
-h, --help: Show this help message and exit.-d, --daemon: Start Capsense in the background.-s, --stop: Stop running instance of Capsense.-r, --reload: Reload the configuration fromconfig.tomlfor the running instance.-S, --status: Check if a Capsense instance is running and show its PID.--gui: Allow Capsense to show GUI windows.--headless: Prevent Capsense from showing any GUI windows.--startup <enable|disable> [--user]: Enable or disable the program starting automatically with Windows.--user: Use user level startup (registry) instead of machine level (task scheduler).- Capsense will always try to disable both kinds of startup when
--startup disableis called.
Capsenseis the default build that includes all features.Capsense-headlessunbundles the GUI components and always runs in headless mode. Ideal if you want extremely low resource usage.
git clone https://github.com/alex3236/Capsense
cd Capsense
# Build the default variant with all features
cargo build
# Build the headless variant without GUI features
cargo build --no-default-features
# Build all
.\build_all.ps1Capsense is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
Capsense is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
