one key for one language→ mac

Index » 喫茶店 (Koohii Lounge)

 
Reply #1 - 2012 June 13, 10:43 am
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Hey all,
I have a Japanese Macbook so I can easily switch between English and Japanese with the default buttons next to the space bar.

However I constantly type Chinese lately, and if I need to go to Chinese input I need to press command+spacebar and go through the list of 4 language setups to get my Chinese. → meaning I often need to press spacebar 3 times just to return to Chinese......

But just like the English and Japanese I'd like to assign one shortcut to instantly go to Chinese, and not go through the list of all options....

After an hour of googling I found nothing, only the list-way. ><

Does anyone know a program that would allow me to do this, or would it be hard to create a small program that allows one shortcut for one language? Just like the English and Japanese button my Japanese macbook has?

Thanks!

-Mesqueeb

Reply #2 - 2012 June 13, 10:47 am
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

I could assign a script to a keyboard shortcut.

Does anyone know how to write a script that does just:
Switch Input Method to Chinese.

This would solve my problem.

Reply #3 - 2012 June 13, 11:03 am
Crispy Member
From: UK Registered: 2012-05-08 Posts: 126

Sorry, don't know. I'd just hit Cmnd + Space and hold Cmnd. It brings up the list on your screen and using the arrow keys is a little bit faster than hitting space bar.

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
Reply #4 - 2012 June 16, 4:37 pm
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Hyperborea wrote:

Find the "Select the previous input source" and "Select next source in Input menu" items. Click on the key combo listed to the right of those items and enter the key or key combo that you would like to use. Those should now be set as the way to do that function.

This is what I am using now and it's too slow ^^ I have to press Cmd Space to get the list, but because I have 4 languages, I often need to press space 3 times more or down arrow after I get the languages list.

I'd like to have just one button to get a language of choice. But I think that's impossible, unless someone knows a script that choses language x.

Reply #5 - 2012 June 16, 7:33 pm
Khakionion Member
From: Nakameguro, Tokyo Registered: 2010-08-11 Posts: 62 Website

It's not impossible, I think, to write an app that would pre-empt presses of the Caps Lock key to switch input modes (that's how Kotoeri does it).

I don't have time this weekend to look at that, but I'd like a similar app for switching between Korean/Japanese/Dvorak, so if I find the time to knock it out I'll update this thread (and the Software Tools thread for good measure).

Reply #6 - 2012 June 17, 1:49 am
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Khakionion wrote:

It's not impossible, I think, to write an app that would pre-empt presses of the Caps Lock key to switch input modes (that's how Kotoeri does it).

I don't have time this weekend to look at that, but I'd like a similar app for switching between Korean/Japanese/Dvorak, so if I find the time to knock it out I'll update this thread (and the Software Tools thread for good measure).

That would be great!
But remember, I don't want a shortcut to go through my input methods Chinese(S)/Chinese(T)/Japanese/Dvorak, because that's already there in MAC with command+space.
Further more, the Japanese keyboard has one key to go to Japanese, and one key to go to english input.

So this is what I want, assign one key to go to traditional Chinese, with one hit of that button, instantly.

(and the CAPS lock key would be a good option!)

Cheers if you can figure something out!

And Cheers because this is the end of my post. ^^

Mesqueeb

Reply #7 - 2012 June 20, 4:18 am
callmedodge Member
From: Tokyo Registered: 2012-02-06 Posts: 69

The button you`re talking about is standard on all Japanese keyboards, Mac or otherwise. I think if you want that you`re going to need to invest in a Chinese keyboard or maybe a custom app might work, I don`t know.

The button is unfortunately not Mac exclusive and doesn`t pertain so much to the Mac software as all input software on both Mac and Windows OS systems. I`ve an American Mac and unfortunately I have to do what you do for Chinese when I want to switch to Japanese. I wouldn`t mind a similar app myself as it is quite a pain in the hole.

Edit: typo

Last edited by callmedodge (2012 June 20, 4:19 am)

Reply #8 - 2012 June 22, 3:42 am
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

callmedodge wrote:

The button you`re talking about is standard on all Japanese keyboards, Mac or otherwise. I think if you want that you`re going to need to invest in a Chinese keyboard or maybe a custom app might work, I don`t know.

The button is unfortunately not Mac exclusive and doesn`t pertain so much to the Mac software as all input software on both Mac and Windows OS systems. I`ve an American Mac and unfortunately I have to do what you do for Chinese when I want to switch to Japanese. I wouldn`t mind a similar app myself as it is quite a pain in the hole.

Edit: typo

Yes, if the Japanese can configure it on Mac's OS, than there should be someone able to know how it's done and assign an extra button for another language right?

I was hoping here, but it seems no one has computer hacking skillz xD

Reply #9 - 2012 June 22, 4:00 am
callmedodge Member
From: Tokyo Registered: 2012-02-06 Posts: 69

You`d have to find the driver file for the keyboard and then find out how to edit that. I`m assuming you can do it on XCode, but I have no skills on this front.

My brother might be up for the challenge. He runs a Macbook himself so I`ll ask him.

Reply #10 - 2012 June 22, 10:14 am
radical_tyro Member
Registered: 2005-11-19 Posts: 272

i also regularly have to cycle through 4 different keyboard layouts and it's a pain to not have have a single shortcut for each one. it might be possible using a keyboard shortcut program together with applescripts.

Reply #11 - 2012 June 23, 1:55 am
jmignot Member
From: France Registered: 2006-03-03 Posts: 205

Same on iPhone/Pad if you happen to use the keyboard for different languages…

Reply #12 - 2012 June 23, 3:17 am
jmignot Member
From: France Registered: 2006-03-03 Posts: 205

There is some information here:
http://tinyurl.com/switch-osx-keyboard
It should then be possible to assign a shortcut to the AppleScript.
However, I tested it manually and it seems to work… except for Japanese:
If I use it to query the current keyboard type when "hiragana" or "katakana" is preselected, it returns "US" whatsoever (or in my case "French", which is the option I select within in the kotoeri preferences in order to be able to use my French "azerty" keyboard). There I am stuck.

So it seems to be a good start but someone should find out how to make it applicable to Japanese too…

Last edited by jmignot (2012 June 23, 3:17 am)

Reply #13 - 2012 June 26, 8:22 am
radical_tyro Member
Registered: 2005-11-19 Posts: 272

i was able to get this working thanks to the page jmignot posted. the end result meets all my desires. here's how:

- go to http://tinyurl.com/switch-osx-keyboard and save the objective C code. the applescript works too but is too slow for me.
- edit the code as the first poster said there so that the japanese layout returns something other than your non-japanese layout: change TISCopyCurrentKeyboardLayoutInputSource to TISCopyCurrentKeyboardInputSource
- compile according to the instructions
- manually switch to each input method you want to set hotkeys for and run the changeInput program from the command line; it spits out the keyboard names.
- now just configure your favorite hotkey app to call /fullPath/changeInput "keyboard name". I used Quicksilver and found that even though you can do it directly with the Terminal plugin, it always brings the terminal app to the front which is not desirable. In my case I made bash scripts to call changeInput with each keyboard name:
#!/bin/sh
/fullPath/changeInput "keyboard name";
and save this to keyboard1.sh, and repeat for other keyboards. Now just set the Quicksilver triggers to launch those scripts. voila!

Reply #14 - 2012 July 09, 6:28 am
Blahah Member
From: Cambridge, UK Registered: 2008-07-15 Posts: 715 Website

This should be a fairly simple program to write if it's only for OS X. Attempting it now...

Reply #15 - 2012 July 09, 9:22 am
shinsen Member
Registered: 2009-02-18 Posts: 181

I don't use Chinese but maybe this will help
http://support.apple.com/kb/HT3560

Reply #16 - 2012 July 19, 4:40 am
Khakionion Member
From: Nakameguro, Tokyo Registered: 2010-08-11 Posts: 62 Website

How specific are you wanting to get? Do you want to be able to hit something weird like CapsLock or Command...or is it fine to hit things like F1-F12, and Command+1 and the like?

Reply #17 - 2012 July 21, 11:14 am
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Blahah wrote:

This should be a fairly simple program to write if it's only for OS X. Attempting it now...

Blahah, that'd be great! I'd love to hear about it if you've drafted something up. ^^

Reply #18 - 2012 July 21, 12:30 pm
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

radical_tyro wrote:

i was able to get this working thanks to the page jmignot posted. the end result meets all my desires. here's how:

- go to http://tinyurl.com/switch-osx-keyboard and save the objective C code. the applescript works too but is too slow for me.
- edit the code as the first poster said there so that the japanese layout returns something other than your non-japanese layout: change TISCopyCurrentKeyboardLayoutInputSource to TISCopyCurrentKeyboardInputSource
- compile according to the instructions
- manually switch to each input method you want to set hotkeys for and run the changeInput program from the command line; it spits out the keyboard names.
- now just configure your favorite hotkey app to call /fullPath/changeInput "keyboard name". I used Quicksilver and found that even though you can do it directly with the Terminal plugin, it always brings the terminal app to the front which is not desirable. In my case I made bash scripts to call changeInput with each keyboard name:
#!/bin/sh
/fullPath/changeInput "keyboard name";
and save this to keyboard1.sh, and repeat for other keyboards. Now just set the Quicksilver triggers to launch those scripts. voila!

What exactly means the objective C code that I must save? ^^

Maybe if someone was able to do this for traditional pinyin, could they share the script here?

Reply #19 - 2012 July 21, 3:59 pm
Khakionion Member
From: Nakameguro, Tokyo Registered: 2010-08-11 Posts: 62 Website

I'm almost done whipping up a nice GUI version that uses hot keys and everything:

http://id.khakionion.com/img/OKOLPreview2.png

I'm busy this week, so I'll try to finish this up the week after. I'll share it with this forum when I'm done.

Reply #20 - 2012 July 23, 10:17 pm
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Thanks man! You'll be making my dream come true!
Can't wait until it's done!! <3

Reply #21 - 2012 July 25, 3:07 am
Onara Member
From: In the kanji zone Registered: 2012-07-11 Posts: 53

Ugh... I run into this problem a lot.
I find myself shuffling between languages all the time:

Swedish (my native tongue) to write to my friends back home, posting on Swedish forums and to write personal stuff.

English to write to college friends and on English-speaking forums.

Farsi to chat with my parents. I guess I could just use Swedish but I like to give them a break sometimes lol. <3

And obviously Japanese when I am studying, jotting down kanjis or googling some...stuff. LOL.

Phew. big_smile

Last edited by Onara (2012 July 27, 12:40 am)

Reply #22 - 2012 July 25, 6:24 am
Tori-kun このやろう
Registered: 2010-08-27 Posts: 1193 Website

@Khakionion

Cool, can you port it to Win32, too? :s Would be awesome big_smile

Reply #23 - 2012 October 04, 5:17 pm
Khakionion Member
From: Nakameguro, Tokyo Registered: 2010-08-11 Posts: 62 Website

Okay, I've produced a finished, polished version. You can download the source for free from Github, or drop $0.99 on it via the Mac App Store:

http://khaka.tk/singleshot

https://github.com/khakionion/onekeyonelanguage

./Michael

Reply #24 - 2012 October 06, 3:45 pm
Mesqueeb Member
From: Japan Registered: 2008-10-14 Posts: 253 Website

Khakionion wrote:

Okay, I've produced a finished, polished version. You can download the source for free from Github, or drop $0.99 on it via the Mac App Store:

http://khaka.tk/singleshot

https://github.com/khakionion/onekeyonelanguage

./Michael

3 questions before I purchase this product:

・Can I set different languages to different keys? Because with the beta I could only set one.
・If not, can I install the program 3 times for three languages?
・Can I assign keys like Caps Lock and option?

Reply #25 - 2012 October 06, 9:54 pm
Khakionion Member
From: Nakameguro, Tokyo Registered: 2010-08-11 Posts: 62 Website

- Nope, that's one of my goals for an upcoming update. (Didn't get any beta feedback, didn't know how important that was/wasn't. wink )
- Hmm, cool idea. I just tried it and it worked once, then stopped working. (I'll see if there are any quick fixes to make that work.)
- Nope, that's one of my goals for an upcoming update. smile

(it's worth pointing out that purchases via the Mac App Store get all future updates for free)

I'm off to Japan for a couple of weeks on vacation, so I'll be working on it later this month. Cheers!

Last edited by Khakionion (2012 October 06, 9:55 pm)