Trying to switch kb layouts, and I keep encountering the message "failed to select keyboard layout" when I do. I initiate this with a trigger (keystroke combination); the only enabled command is "Set keyboard layout to...".
Is there a reason why?
Sorry but there is not enough info here to help. Please see
and also specify which keyboard layouts you are trying to select
together with an image of your current macro
Let me be more specific. I've written to this forum about the issue before but maybe things have changed.
I type in Ancient Greek with a Greek font (NAU) and in English with Times New Roman. The Greek is mapped onto a Greek Keyboard layout called "GreekKeys Unicode (US)", localized for US keyboards.
To switch to the font and use it properly (to render Greek on the screen/page) I need to switch keyboard layouts. To return to English I need to return to a US layout (either US or ABC Extended).
This is my macro:
I added a pause because it seemed to help at one point.
This is my return to English macro:
The TNR macro works fine. The Greek one produces the error message.
Let me know if you need more specifics. Thanks.
Please try invoking the switch to greek from the KM status menu
Where did you get the Greek keyboard definition file from?
Is this a standard Apple key file definition?
It might be worth trying a "different supplier/source" for your Greek key definitions
Apart from finding your original post, I also found these, which might be relevant,
I have a few hotkeys to change the keyboard layout to different languages like Korean, Japanese, Chinese and so on.
It often happens that the layout in the status bar is changed, the actual input but still the same as before. In this case I have to tab into a different app, or invoke spotlight / Alfred once before I can write in the new layout.
This happens randomly, sometimes it works fine, sometimes it doesn’t.
I read somewhere that this is a known problem in OSX. Is there a way with KM to …
If you change languages, here is a macro to make that more powerful than the standard System Preferences (Sys Prefs).
Using the shortcut in Sys Prefs is tempting because it is simple:
Apple Menu > System Preferences > Keyboard > Shortcuts
But that is limited to only one action -- just changes the keyboard language -- with no options for any leverage.
With a KM macro, you can add other actions to be done at the same time.
Change language, change type font, change fon…
There is also a hint on stackoverflow that you may need a command +space or similar to complete the switch, but I think yours is failing before that point.
Finally there may be an alternative way using a shell or applescript.
I can now report back a solution that I just found: KAWA, an app from
this site (Github). Works perfectly. I recommend it to all. I was able to incorporate Kawa's keystrokes into my KBM macros.
Thanks for the tips.