Code Monkey home page Code Monkey logo

im-select's Introduction

Hi 👋, I'm Steve Dai

I was a iOS developer. I was working in Alibaba after I graduated from Huazhong University of Science and Technology, and then I jumped to Tencent. For now, I'm majoring in microchip of Self-driving car in Huawei Technologies Co., Ltd. I like coding very much. In addition, I like pingpang tennis, swimming, running, skateboarding. I like writing as well, you can follow my wechat official account: @steve_dai. And now, I'm falling in love. My girl is also a programmer, I love her and I wana marry her!

  • 🔭 I’m currently working on driveless car's microchip!

Languages and Tools:

objectivec arduino bash flutter git hexo linux nodejs python realm

🏆🏆🏆

trophy

im-select's People

Contributors

cherrot avatar daipeihust avatar elsejj avatar heshiyou avatar igorechek06 avatar leisurelicht avatar liwanwhu avatar nzig avatar tarruella avatar yunhao94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

im-select's Issues

rime 小狼毫輸入法不生效

如果可以支持riem输入法的中英文模式那就太好了,riem支持的按键模式比较多,习惯了mac的键位,在win上可以用riem直接调成一样的

Switching IM does not affect immediately

I tried to do im-select com.apple.inputmethod.Kotoeri.Roman on terminal, but nothing was changed except IM icon on menu bar.
But after switching to other application, I could input with desired IM.

Is this a bug of macOS?

切换输入法后,菜单栏的输入法变化了,但是按键按下的还是上次使用的输入法输出

运行环境

# ganzhixiong @ ganzhixiongdeMacBook-Pro-3 in ~ [14:28:17] C:1
$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G9028

复现流程

1. 创建一个 Shell 脚本

#!/bin/zsh

# cd /usr/local/bin/
# echo $(pwd)
# open http://www.github.com/GanZhiXiong/1$(pwd)2/

current_input_source=$(/usr/local/bin/im-select)
echo $current_input_source

if [ "$current_input_source" = "com.apple.keylayout.ABC" ]; then
    /usr/local/bin/im-select com.sogou.inputmethod.sogou.pinyin
else
    /usr/local/bin/im-select com.apple.keylayout.ABC
fi

2. 通过 Karabiner-Elements 或其他软件配置按下 Shift 触发此脚本

3. 复现

  1. 打开 Chrome 随便定位一个输入框。
  2. 切换输入法到 abc。
  3. 切换应用到 VSCode。
  4. 切换应用到 Chrome。
  5. 切换输入法到搜狗。
    此时无法菜单栏输入法图标变成了搜狗,但是在输入框中打字,输出的确实英文。

你好,仓库里没有已经编译好的.exe文件。

首页readme,windows 节的32bits/64bits二进制文件下载地址,都报错了,无法下载。
本想用源码自己编译,但这个机器上缺乏c的编译环境,又不敢折腾这个环境,毕竟是服务器....

希望作者把缺失的.exe文件补传一下,32/64bits都需要,非常感谢。

我使用的 win7 无论何种输入法,im-select 的结果一直是 2052

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ hello
bash: hello: command not found

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ /e/software/im-select.exe
2052

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ /e/software/im-select.exe 0

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ /e/software/im-select.exe 0

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ 你好
bash: 你好: command not found

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$ /e/software/im-select.exe
2052

Administrator@Win7-2019NTGGLF MINGW64 /e/software
$

Error switching to IM

使用报错

Error switching to IM. err=Error: Command failed: /usr/local/bin/im-select com.apple.keylayout.US

环境:
mac10.15.6

window下使用,会导致c操作符的光标位置与样式不正确

win11,使用c操作符,例如ciw后,光标依然是normal模式下的光标,再输入字符后才变回正确的。如果ciw用在一行的最后一个单词,光标位置会在最后一个字符的前面,而不是行末,例如 let str=fun.value ,在value上使用ciw,光标会在点号.的前面,只是光标样式不正确,是normal时的样式,视觉样是在点号.的上面。但是,每个文档的第一次使用c操作符,光标位置与样式是正确的,从第二次往后就出现错误了。
im-select

我想跟你联系一下

您好,我写了一个IDEA的插件跟你这个命令行程序的功能差不多.
我希望您能为我提供一些帮助.

可以只切换中英吗?

你好! 大兄弟, 可以只切换中英吗? 我不需要美式键盘啊!

识别不了一个输入法的中英两种状态

one way to change ascii_mode for fcitx5-rime(not im) [一种切换rime中英文模式的方法,而不是切换输入法]

system: arch linux
input tool: fcitx5+rime

reference: fcitx/fcitx5-rime#30 (comment)

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "b true",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/busctl call --user org.fcitx.Fcitx5 /rime org.fcitx.Fcitx.Rime1 IsAsciiMode",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/busctl call --user org.fcitx.Fcitx5 /rime org.fcitx.Fcitx.Rime1 SetAsciiMode {im}",

About Linux

This is my setting on Debian Linux testing.

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "xkb:us::eng",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/ibus engine",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/ibus engine {im}"

I think you can do something better.

Error executing lua callback: Vim:E475: Invalid value for argument cmd: 'im-select' is not executable

MacOS: 10.15.7
NeoVim: 0.8.3

M.macInsertLeave = function()
  M.currentIM = vim.fn.system({ "im-select" })  --  Invalid value for argument cmd: 'im-select' is not executable
  vim.cmd(":silent :!im-select" .. " " .. M.defaultIM)
end

处理 InsertLeave 自动命令 "*" 时发生错误: Error executing lua callback: Vim:E475: Invalid value for argument cmd: 'im-select' is not executable stack traceback: [C]: in function 'system'

不能识别搜狗输入法通过 shift 切换的中英文状态

因为我只使用 搜狗输入法 for Mac - 支持全拼、双拼、模糊输入、苹果输入、云输入 这一个输入法,在需要使用英文时,我使用 shift 来切换(搜狗支持通过配置 shift 切换中英文)。
但是 macism 不能获取搜狗中英文状态,搜狗输入法在中文或英文状态下 macism 获取的输入源都只有一个,即 com.sogou.inputmethod.sogou.pinyin

  • 能解决这个问题吗?
    应该还有很多人有这样的需求。期待能解决。
  • 或者有没有其他软件能识别搜狗输入法通过 shift 切换的中英文状态?

插件会导致c操作符错误

当使用c操作符,例如ciw,虽然已经切换到插入模式,但是光标样式依然停留在普通模式。如果ciw把单词删掉后,正确的光标位置应该是在行尾的,但是却在最后一个字符前,光标也是错误。

我使用的是win11操作系统。在vim插件上也有人留言这个问题,一开始以为是vim插件的问题,后来发现,如果不使用im-select就不会发生上述的错误。

about vscode's vim.autoswitchinputmethod

it's my setting for vscode:
vim.autoswitchinputmethod.enable:true,
vim.autoswitchinputmethod.defaultIm:"1033",
vim.autoswitchinputmethod.obtainIMcmd:"E:\VS_Code\bin\im-select.exe",
vim.autoswitchinputmethod.switchIMcmd:"E:\VS_Code\bin\im-select.exe {im}"

and,i've already installed babun.but, i can't enjoy the im-select.who can help me ?

mac无法使用

输入im-select提示
/usr/local/bin/im-select: line 8: syntax error near unexpected token newline' /usr/local/bin/im-select: line 8: '

启用 autoSwitchInputMethod 后 C/cw 命令无法正常工作

系统:Windows 11。

不确定是 VS Code 还是 im-select.exe / im-select-mspy.exe 的问题。

以 cw 命令为例:

当前现象:

原始内容(普通模式,光标在数字 3):
1234
  ^

执行 cw 命令:
1|2

输入任意文本,例如 aa:
1aa|2

图示:https://imgse.com/i/7y2Fte

期望:

原始内容(普通模式,光标在数字 3):
1234
  ^

执行 cw 命令:
12|

输入任意文本,例如 aa:
12aa|

如何设置单向切换?

  "vim.autoSwitchInputMethod.enable": true,
  "vim.autoSwitchInputMethod.defaultIM": "com.apple.keylayout.ABC",
  "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select",
  "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}",

这样设置之后,输入法会在 normal 和 insert 之间切换,我想设置成单向,只在 insert --> normal 的时候切换到 ABC,而在 normal --> insert 之时不做任何切换。可以这样设置吗?

Configuration: Unable to find "D:\\bin\\im-select.exe".

我尝试着将下载好的 im-select.exe 64位 放置到了 如上路径 "D:\Program Files\im-select.exe",然后启动程序的时候就一直提醒我:

Configuration: Unable to find "D:\Program Files\im-select.exe". Check your 'vim.autoSwitchInputMethod.obtainIMCmd' in VSCode setting.

配置如下图:
image

路径也已经添加到了系统变量和账户变量中去了:
image

切换第三方中文输入法之后无法立即激活输入法

您好!我在使用 im-select 的过程中遇到了一个问题。

OS: macOS Catalina 10.15.4

使用 im-select 切换第三方输入法(Squirrel、搜狗)之后,无法立即激活输入法,输入法选项只有一行 “..........”
Screen Shot 2020-04-15 at 9 56 25 AM

只有当聚焦到另一个应用窗口之后,输入法才会被激活。

此现象并不能 100% 复现,偶尔能够成功切换。

fcitx5 输入法切换问题

当我在 insert 模式下输入法是中文时,没有什么问题,但如果我在 insert 模式下输入法是英文时,就会给我切换成中文。这个不是我想要的效果,我想要在任何情况下到 normal 模式都是英文输入法,像 fcitx.vim 一样。

Add another option for Linux configuration in README.md

On some desktop environment (e.g cinnamon) ibus may not work properly. So another option is using xkb-switch tool.

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "us",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/xkb-switch",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/xkb-switch -s {im}"

I think mentioning it in README.md can save someone's time.

im-select-mspy 执行后到最终退出间隔很长时间

2023-06-21-19-53-31-min

现象描述:使用 im-select-mspy.exe 实现语言切换功能时,执行后程序退出需要等待很长时间
导致问题:当使用 neovim 等执行切换命令时,光标恢复功能需要等 im-select-mspy.exe 执行结束,这导致每次按 ESC 之后都要等相应时间
neovim命令:autocmd InsertLeave * :silent !im-select-mspy.exe 英语模式
想请问下是什么原因会导致需要等待这么长时间才能退出,有没有什么解决办法?或者排查的办法?

Proposed methods don't work for Fedora 35

Found a solution based on the last method with get-im/set-im scripts but using gsettings instead of gdbus:

get-im.sh

#!/bin/bash

# "mru" stands for "most recently used"
gsettings get \
	org.gnome.desktop.input-sources mru-sources \
	| awk -F "), " ' { print $1 } ' \
	| awk -F\' ' { print $4 } '

set-im.sh

#!/bin/bash

gsettings set \
	org.gnome.desktop.input-sources sources "[('xkb', '$1')]"

# here you have your own list of languages which you can get via 
# `gsettings get org.gnome.desktop.input-sources sources`
gsettings set \
	org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ru')]"

Trick is that gsettings holds active that single option you pass to it in the first set command.

Hope this helps somebody.
Please consider appending to docs.

用 im-select 自动切换输入法(鼠须管),不生效, 必须手动切换才有效

Describe the bug
在 MacOS 中,无法通过 im-select 命令来切换输入法
就算切换到了苹果自带的英文(状态栏都显示改变了),
再次输入, 用的还是鼠须管在输入

To Reproduce

  1. 切换到 鼠须管
  2. 用命令切换苹果自带的英文输入法(是启用的)
im-select com.apple.keylayout.ABC

3.(此时:状态栏已经改变)再次输入,发现并没有切换到英文输入法

Expected behavior
直接就切换输入法, 不要切换到英文输入法后,还是中文

Screenshots

preview.mp4

Flavor(please complete the following information):
Select your flavor:

  • ibus-rime
  • fcitx-rime
  • fcitx5-rime
  • Squirrel
  • Trime
  • Weasel

Package:

  • OS: MacOs
  • Version: 13.2.1 22D68 x86_64

Additional context

虽然用命令切换不生效, 但是手动用快捷键切换是会生效的

刚用这个,不太懂这是im-select的问题,还是输入法的问题

** end **

谢谢你做的这个项目,非常好用,哈哈 :) 👍 💯

macos 13 无法运行

➜ ~ im-select
/usr/local/bin/im-select: line 8: syntax error near unexpected token newline' /usr/local/bin/im-select: line 8: '
➜ ~

sometimes the target input method will stuck on loading after swiching

Hi, I used to using Karabiner to customize the shortcuts to trigger im-select switching input methods, like the following one, which uses right_shift + s to switch to squirrel input method:

{
  "from": {
        "key_code": "s",
        "modifiers": {
            "mandatory": [
                "right_shift"
            ]
        }
    },
    "to": [
        {
            "shell_command": "/usr/local/bin/im-select im.rime.inputmethod.Squirrel.Hans"
        }
    ],
    "type": "basic"
},

However, I found that sometimes after switching, the input method will stuck on loading, showing some dots only ..... (the following is another Japanese input method, while this issue has occurred with all input methods except native English)
image
Whereas manually switching by clicking on the input method will never cause this.

Any idea about this issue?

可以修改再次进入编辑模式时的输入法吗

我每次在输入完中文后会特意手动切换到中文输入法的英文模式,这时再退出输入模式,但当我再次进入Vim的编辑模式时,输入法就自动变成了中文拼音模式,这样如果我需要输入代码的话,我还要按手动切换到英文模式,这样的话,还是很麻烦的
vim

Input methods for KDE

I'm using Kubuntu 22.04, have reasons to avoid ibus or fcitx, just trying to keep everything by default :)

I have a problem with proposed xkb-switch method: it works, but it makes the language indicator disappear from system tray, so and global menu for VSCode.

It took a while to find the solution, here's my working settings.json:

{
    "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/qdbus org.kde.keyboard /Layouts getLayout",
    "vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/qdbus org.kde.keyboard /Layouts setLayout {im}",
    "vim.autoSwitchInputMethod.defaultIM": "0",
    "vim.autoSwitchInputMethod.enable": true
}

Please, add it to README.md, cheers!

UPD: params added for obtainIMCmd.

sway input method

https://github.com/swaywm/sway

this configuration works for me on Sway:

  "vim.autoSwitchInputMethod.defaultIM": "0",
  "vim.autoSwitchInputMethod.obtainIMCmd": "/home/user/.config/sway/get-im.sh",
  "vim.autoSwitchInputMethod.switchIMCmd": "/home/user/.config/sway/set-im.sh {im}",
  "vim.autoSwitchInputMethod.enable": true,
 ❯ cat ~/.config/sway/get-im.sh
#!/bin/sh
source $(dirname "$0")/.env
swaymsg -t get_inputs | jq -r "[.[] | select(.identifier == \"$KEYBOARD\")][0] | .xkb_active_layout_index"
 ❯ cat ~/.config/sway/set-im.sh
#!/bin/sh
source $(dirname "$0")/.env
swaymsg input "$KEYBOARD" xkb_switch_layout "$1"
 ❯ cat ~/.config/sway/.env
# swaymsg -t get_inputs  
KEYBOARD='6700:8484:SEM_USB_Keyboard'

m1 Mac 支持

m1 Mac 适配版本 release 时间有计划吗?

How to switch different modes of an input method?

How to switch different modes of an input method?

I'm windows user.

I want to switch between different input ways, like from chinese to english.
other than from Chinese (Simplified) - US Keyboard(2052) to United States - English(1033).

Do you have any solutions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.