-
Hi, wanted to say Thank you for this great utility. I am trying to setup 3 language toggle on my right command with such logic
Is it possible in general? rule("Switch between RU, EN and UK with double / single cmd press, for mac keyboard")
.manipulators([
mapDoubleTap("right_command")
.toInputSource({ language: "uk" })
.condition(ifDevice({ vendor_id: APPLE_VENDOR_ID })),
map("right_command")
.toIfAlone({ select_input_source: { language: "ru" } })
.condition(ifInputSource([{ language: "en" }]))
.condition(ifDevice({ vendor_id: APPLE_VENDOR_ID }))
.parameters({
"basic.to_if_alone_timeout_milliseconds": DEFAULT_TIMEOUT,
}),
map("right_command")
.toIfAlone({ select_input_source: { language: "en" } })
.condition(ifInputSource([{ language: "en" }]).unless())
.condition(ifDevice({ vendor_id: APPLE_VENDOR_ID }))
.parameters({
"basic.to_if_alone_timeout_milliseconds": DEFAULT_TIMEOUT,
}),
]), |
Beta Was this translation helpful? Give feedback.
Answered by
evan-liu
Jul 15, 2024
Replies: 2 comments 2 replies
-
Hi @Sinled, can you try if this works for you: rule(
'Switch between RU, EN and UK with double / single cmd press, for mac keyboard',
).manipulators([
withCondition(ifDevice({ vendor_id: APPLE_VENDOR_ID }))([
// ›⌘ ›⌘ -> uk
withCondition(ifVar('double-right-cmd'))([
map('right_command').toInputSource({ language: 'uk' }),
]),
// ›⌘ en -> ru
withCondition(
ifInputSource({ language: 'en' }),
ifVar('double-right-cmd').unless(),
)([
map('right_command')
.toIfAlone(toInputSource({ language: 'ru' }))
.to('right_command')
.toVar('double-right-cmd')
.toDelayedAction(
toSetVar('double-right-cmd', 0),
toSetVar('double-right-cmd', 0),
)
.parameters({
'basic.to_if_alone_timeout_milliseconds': DEFAULT_TIMEOUT,
}),
]),
// ›⌘ ru -> en
withCondition(
ifInputSource({ language: 'en' }).unless(),
ifVar('double-right-cmd').unless(),
)([
map('right_command')
.toIfAlone(toInputSource({ language: 'en' }))
.to('right_command')
.toVar('double-right-cmd')
.toDelayedAction(
toSetVar('double-right-cmd', 0),
toSetVar('double-right-cmd', 0),
)
.parameters({
'basic.to_if_alone_timeout_milliseconds': DEFAULT_TIMEOUT,
}),
]),
]),
]) |
Beta Was this translation helpful? Give feedback.
0 replies
-
It seems it is working, Thanks |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you try
toIfHeldDown()
instead ofto()
,And try different values for
You may need to hold the key at least for
"basic.to_if_held_down_threshold_milliseconds"
, and longer than"basic.to_if_alone_timeout_milliseconds"
, before pressing another key.