This is a fake fcitx-remote
for Windows so that it can be used by
fcitx.el. Inspired by fcitx-remote-for-osx.
For Vim users: This program might also be able to be used by
fcitx.vim
. I haven’t tested it and I probably won’t since I don’t
use Vim myself. If you’re interested, help me out by submitting PRs or
reporting issues.
You can change the key combination to toggle the input method if you build the program by yourself.
In current code, ALT+SHIFT
is set as the default key combination
to toggle the input method.
This project is built from Visual Studio 2013. Import the project into Visual Studio and build the executable file.
You can download the pre-built releases in the GitHub project homepage. Two versions available:
- Use
ALT+SHIFT
as the toggle key: download link - Use
WIN+SPACE
as the toggle key: download link
Choose the one that fits you.
This program toggles the input method by simulating ALT+SHIFT
or
WIN+SPACE
keys, which means you need to make sure you can use
ALT+SHIFT
or WIN+SPACE
to switch between English and Chinese
input method.
If you’re using WIN+SPACE
to toggle the input method, add the
following settings to your init.el
so that WIN+SPACE
can be
handled by the Windows instead of Emacs:
(setq w32-pass-lwindow-to-system nil)
(setq w32-lwindow-modifier 'super)
Also, make sure fcitx-remote
is in your PATH
and exec-path
. If
not, use the following code in your init.el
:
(let ((fcitx-path "C:/path/to/fcitx-remote"))
(setenv "PATH" (concat fcitx-path ";" (getenv "PATH")))
(add-to-list 'exec-path fcitx-path))
Currently this program works great, but still has some minor problems:
SendInput
can’t guarantee the keyboard input sequence it has sent to be processed before it returns. In some sense, it is not fully synchronized (please correct me if I’m wrong). Therefore, sometimes if you’re typing really fast, the input method may not be closed before your next input. I noticed this when I tested theprefix-keys
feature offcitx.el
.ALT+SHIFT
orWIN+SPACE
is not configurable right now.
- Better implementation instead of using
SendInput
. - Make the toggle key (
ALT+SHIFT
orWIN+SPACE
) configurable. - Support more command line options. Currently only
-c
and-o
are supported.fcitx-remote
will print the status in all the other cases. The current approach is already enough to makefcitx.el
work properly. - Check Vim plugin compatibility: help needed, since I don’t use Vim myself.