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

preferencesAboutTextFull
Craig Watson 9 years ago
parent be0c3a6aaa
commit e1014a0138
  1. 5
      src/frameworks/UBPlatformUtils_mac.mm
  2. 6
      src/gui/UBKeyboardPalette_mac.mm

@ -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 @@
#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()
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()
} }
} }
} }
*/
} }
void UBKeyboardPalette::onActivated(bool) void UBKeyboardPalette::onActivated(bool)

Loading…
Cancel
Save