How to set right_shift = command+space?
You can't until #16 is fixed.
keep on watching this.
@jinjian1991
check this comment
I guess you want to switch input source. But you cannot map shift to command space to do that. Following is an example to switch between sogou input and ABC keyboard. Pay attentation to the input_source_id is for keyboard layout and input_mode_id is for some input software(for example chinese sogou). You can get this information from ~/Library/Preferences/com.apple.HIToolbox.plist
This script is modfied on these two offical examples
example_input_source.json
example_select_input_source.json
{
"description": "LeftShift to Switch Input Source",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
"input_sources": [
{
"language": "en"
}
]
}
],
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"input_mode_id": "com.sogou.inputmethod.pinyin"
}
}
]
},
{
"conditions": [
{
"type": "input_source_unless",
"input_sources": [
{
"language": "en"
}
]
}
],
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"input_source_id": "com.apple.keylayout.ABC"
}
}
]
}
]
}
Thanks @jerryjune , it's great . Now I could switch input source between RIME and apple.US .
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@jerryjune it's great.
Thanks @jerryjune .
I struggled for an hour and finally found the slightly difference between input_source_id and input_mode_id 😭
I will list my config below in case it can help someone use ”U.S.“ and "Pinyin - Simplified" like me:
{
"description": "LeftShift to Switch Input Source",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"input_source_id": "com.apple.keylayout.US"
}
],
"type": "input_source_unless"
}
],
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"input_source_id": "com.apple.keylayout.US"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"input_mode_id": "com.apple.inputmethod.SCIM.ITABC"
}
],
"type": "input_source_unless"
}
],
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"input_mode_id": "com.apple.inputmethod.SCIM.ITABC"
}
}
],
"type": "basic"
}
]
}
Most helpful comment
I guess you want to switch input source. But you cannot map shift to command space to do that. Following is an example to switch between sogou input and ABC keyboard. Pay attentation to the input_source_id is for keyboard layout and input_mode_id is for some input software(for example chinese sogou). You can get this information from ~/Library/Preferences/com.apple.HIToolbox.plist
This script is modfied on these two offical examples
example_input_source.json
example_select_input_source.json