Expand description
A cross-platform input method switcher.
im-switch provides a unified API to query, switch, and list input methods across Linux, Windows, and macOS.
§Platform support
| Platform | Backend |
|---|---|
| Linux | fcitx5 (D-Bus), ibus (CLI) — auto-detected at runtime |
| Windows | Win32 API (keyboard layout + IME on/off control) |
| macOS | Carbon TIS API |
§Quick start
use im_switch::{get_input_method, set_input_method, list_input_methods};
// Get the current input method
let im = get_input_method().unwrap();
println!("Current IM: {im}");
// List available input methods
let methods = list_input_methods().unwrap();
for m in &methods {
println!(" {m}");
}
// Restore a saved input method
set_input_method(&im).unwrap();Enums§
- ImSwitch
Error - Error type for input method operations.
Functions§
- get_
input_ method - Returns the current input method identifier.
- list_
input_ methods - Returns a list of available input method identifiers.
- set_
input_ method - Sets the input method to the specified identifier.