New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add action: Switch to a specific input source #680

Closed
technolingo opened this Issue Mar 17, 2017 · 17 comments

Comments

Projects
None yet
5 participants
@technolingo

technolingo commented Mar 17, 2017

Description of bug/feature request/question:

I use multiple input sources on my Mac, I would like to set up specific hotkeys for each input source/method.

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Mar 18, 2017

You mean languages? I think you might be able to change that with an AppleScript

@technolingo

This comment has been minimized.

technolingo commented Mar 19, 2017

So is true with everything else BetterTouch Tool does, but I bought this app to make my life easier. It would be nice to have a designated hotkey or gesture for each language input method.

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Mar 19, 2017

Yeah, but you can BTT to invoke an AppleScript that changes the language input

@technolingo

This comment has been minimized.

technolingo commented Mar 21, 2017

Yeah, you are right. Problem solved using Applescript. I've just discovered a simple and powerful tool.

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Mar 21, 2017

All right great to hear that

@fifafu

This comment has been minimized.

Collaborator

fifafu commented Mar 24, 2017

Would be great if you could post the Apple Script you are using for future reference!

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Mar 24, 2017

@fifafu perhaps it's this or this. I haven't tried those, though.

@technolingo

This comment has been minimized.

technolingo commented Mar 25, 2017

@fifafu Great idea! This is my first time posting on this site, still adapting to the culture.

Below is the code I used:


on changekeyboardlayout(layoutName)
	tell application "System Events" to tell process "SystemUIServer"
		tell (1st menu bar item of menu bar 1 whose description is "text input") to {click, click (menu 1's menu item layoutName)}
	end tell
end changekeyboardlayout

changekeyboardlayout("British")

------------(code finished)-----
Note that keyboard layout names are localised, so if your system's language isn't English, then you should use the appeared layout names in the system's language, e.g. "美式英文", "Español".

@idoo

This comment has been minimized.

idoo commented Apr 17, 2017

Mac has default widget for such action, but I can't use it when I overwrite default panel layout, so it would be nice to have such in BetterTouchTool

I created better solution for change layout

tell application "System Events"
  key code 49 using {command down}
end tell

(it works for me, because I using cmd + spc to switch layout)
But still didn't find a option to get current input source name

@idoo

This comment has been minimized.

idoo commented Apr 18, 2017

as I understand there is no easy way to get current input source from console to show it on touchbar

I'm not sure, can you reuse standard widget from sierra, but it works nice

@fifafu so, it would be awesome to give some ability to create fully custom touchbar for non english native speakers ;) Please let me know if I can help you with implementation or testing.

@idoo

This comment has been minimized.

idoo commented Apr 26, 2017

@fifafu how much we have to donate for such feature?)

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Apr 30, 2017

@idoo What actually are you asking for? I'm not too sure tbh

By the way, he's probably not replying because he hasn't been online for a while

@idoo

This comment has been minimized.

idoo commented May 2, 2017

@cleverjackal I mean that would be nice to add widget to that group http://take.ms/kFsr7 to indicate current input source language and switch it by tapping

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented May 7, 2017

Ah, I see. Nice!

@idoo

This comment has been minimized.

idoo commented May 31, 2017

@cleverjackal please let me know if I can help you somehow
Probably this repo can help you or this answer

@cleverjackal

This comment has been minimized.

Contributor

cleverjackal commented Jul 6, 2017

@idoo Oh thanks, but I wasn't looking for it. Maybe @fifafu wants it

@xaralis

This comment has been minimized.

xaralis commented Apr 5, 2018

@idoo For the record, it can be easily achived using this small bin: https://github.com/myshov/xkbswitch-macosx

You can then use this shell script with Better Touch Tool and embed it in a nice button, even with icons.

screenshot 2018-04-05 22 59 26

It will result in something like this:

screenshot 2018-04-05 23 01 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment