Commit e1014a01 authored by Craig Watson's avatar Craig Watson

re-enabled keyboard switching on Mac OS // functionality is still spotty..

parent be0c3a6a
...@@ -537,11 +537,14 @@ void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id) ...@@ -537,11 +537,14 @@ void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id)
const char * strName = id.toLatin1().data(); const char * strName = id.toLatin1().data();
CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingMacRoman ); CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingISOLatin1 );
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID }; CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID };
CFStringRef values[] = { kTISCategoryKeyboardInputSource, iName }; CFStringRef values[] = { kTISCategoryKeyboardInputSource, iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 2, NULL, NULL); CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 2, NULL, NULL);
// get list of current enabled keyboard layouts. dict filters the list
CFArrayRef kbds = TISCreateInputSourceList(dict, true); CFArrayRef kbds = TISCreateInputSourceList(dict, true);
if (kbds!=NULL) if (kbds!=NULL)
{ {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
#include <QMap> #include <QMap>
#include <QString> #include <QString>
...@@ -75,8 +76,7 @@ void UBKeyboardPalette::createCtrlButtons() ...@@ -75,8 +76,7 @@ void UBKeyboardPalette::createCtrlButtons()
void UBKeyboardPalette::checkLayout() void UBKeyboardPalette::checkLayout()
{ {
/*
* REMOVED FOR NOW -- check if is still needed in 10.9/10.10
TISInputSourceRef selectedLocale = TISCopyCurrentKeyboardInputSource(); TISInputSourceRef selectedLocale = TISCopyCurrentKeyboardInputSource();
CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(selectedLocale, CFStringRef sr = (CFStringRef) TISGetInputSourceProperty(selectedLocale,
...@@ -99,7 +99,7 @@ void UBKeyboardPalette::checkLayout() ...@@ -99,7 +99,7 @@ void UBKeyboardPalette::checkLayout()
} }
} }
} }
*/
} }
void UBKeyboardPalette::onActivated(bool) void UBKeyboardPalette::onActivated(bool)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment