Make sure you get the Mac driver and restart your computer after installing it. If it doesn't work, visit the manufacturer's website to check for any special drivers you need to install. To connect a USB keyboard, simply plug it in and macOS will detect it. Connecting a Third-Party Keyboard to Your Mac If you're planning to buy a new keyboard instead, take a look at the best alternatives to the Magic Keyboard for macOS-focused options. For example, the Razer Synapse software that allows for macro recording on Razer keyboards is available for Mac these days.įor the most part, you can use any third-party keyboard you find around the house and there's a good chance it'll work with your Mac. That said, the situation is improving with popular manufacturers. ![]() Special media keys may not work, but we'll show you some apps you can use to fix them later.Īdvanced features on more technical keyboards are also less likely to work with your Mac. So any USB or Bluetooth keyboard should be compatible-at least for basic features like typing standard keys. Modern Macs support nearly all USB and Bluetooth devices. Using a Third-Party Keyboard With Your Mac # !! *.Here's all you need to know about using third-party keyboards on Mac, including how to set them up for maximum productivity. # !! First, ensure that the plist cache is flushed and that the Set plistPath to "~/Library/Preferences/" Download Keyboard Pilot for macOS 10.9 or later and enjoy it on your Mac. # Surprisingly, using POSIX-style paths (even with '~') works with Read reviews, compare customer ratings, see screenshots and learn more about Keyboard Pilot. Set activeKbdLayout to my getActiveKeyboardLayout() # ->, e.g., "U.S." Note: Obviously, the above shell-based approach is much shorter in this case, but the code below demonstrates general techniques for working with property lists. Turns out that AppleScript itself can parse property lists, but it's a bit like pulling teeth.Īlso, incredibly, the potentially-not-fully-current-values problem also affects AppleScript's parsing.īelow is an AppleScript handler that gets the current keyboard layout it uses a do shell script-based workaround to ensure that the plist file is current, but otherwise uses AppleScript's property-list features, via the Property List Suite of application System Events. ![]() Since defaults read cannot return an individual key's value, the value of interest must be extracted via egrep and sed - one caveat there is that defaults read conditionally uses double quotes around key names and string values, depending on whether they are a single word (without punctuation) or not.defaults read ensures that the current settings are read (sadly, as of OSX 10.9, the otherwise superior /usr/libexec/PlistBuddy sees only a cached version, which may be out of sync). ![]() The currently selected keyboard layout is stored in the user-level file ~/Library/Preferences/, top-level key AppleSelectedInputSources, subkey KeyboardLayout Name.If you want to execute the same command directly from the shell (as one line), it would be:ĭefaults read ~/Library/Preferences/ AppleSelectedInputSources | egrep -w 'KeyboardLayout Name' |sed -E 's/^. = \"?( )\"? $/\1/' ![]() Note how \ is escaped as \\ for the benefit of AppleScript, which ensures that just \ reaches the shell. Note: deserves credit for coming up with the fundamental approach - where to look and what tools to use.Īfter further investigation and back and forth in the comments I thought I'd summarize the solution (as of OS X 10.9.1): do shell script "defaults read ~/Library/Preferences/ \\Įgrep -w 'KeyboardLayout Name' | sed -E 's/^. = \"?( )\"? $/\\1/'"
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |