Platforms to show: All Mac Windows Linux Cross-Platform

Back to TextInputSourceMBS class.

TextInputSourceMBS.CreateASCIICapableInputSourceList as TextInputSourceMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a list of ASCII-capable keyboard input sources.

This list represents a snapshot of ASCII-capable keyboard input sources enabled when the call was made. Successive calls to CreateASCIICapableInputSourceList may return different results because, for example, in between the calls the user may enable or disable an input source in the International Preferences pane. When a keyboard input source is enabled or disabled, by the user or programmatically, the distributed CF notification kTISNotifyEnabledKeyboardInputSourcesChanged is posted.

Some examples using this method:

TextInputSourceMBS.CreateInputSourceList(properties as dictionary, includeAllInstalled as boolean) as TextInputSourceMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a list of input sources that match specified properties.
Example
// show keyboard viewer
Dim d As New Dictionary
d.Value(TextInputSourceMBS.kTISPropertyInputSourceID) = "com.apple.KeyboardViewer"

Dim sources() As TextInputSourceMBS = TextInputSourceMBS.CreateInputSourceList(d, False)
If UBound(Sources) >= 0 Then
sources(0).SelectIt
End If

properties: A dictionary of property keys and corresponding values to filter the input source list. May be nil, in which case no filtering is performed.
includeAllInstalled: Typically, set to false so that only enabled input sources are included; set to true to include all installed input sources that match the filter .

Returns an array for a list of text input source references that match the specified properties.

This list represents a snapshot of input sources that matched the properties specified when you made the call. If you want to include input sources that are installed but not currently enabled, set the includeAllInstalled parameter to true. Typically, you do this to obtain a text input source reference for a newly installed input source. In this case, the properties parameter would include very specific criteria limiting the matching input sources.

Important: Calling this function with the includeAllInstalled parameter set to true can have significant memory impact on the calling application if the properties parameter is nil (match all) or if it specifies criteria that might match many installed input sources. This setting might force caching of data for all matching input sources and result in an allocation of up to 120K.
If you are calling CreateInputSourceList to find a specific input source or sources from among the sources included in the list, first call CreateInputSourceList with includeAllInstalled set to false and check whether the returned array includes the desired input source(s). If this is not the case, call CreateInputSourceList again with the includeAllInstalled parameter set to true.
none

Some examples using this method:

TextInputSourceMBS.CurrentASCIICapableKeyboardInputSource as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the most recently used ASCII-capable keyboard input source.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.CurrentASCIICapableKeyboardInputSource

MsgBox t.LocalizedName

Returns text input source reference for the most recently used ASCII-capable keyboard input source.

If no ASCII-capable keyboard input source has been used yet, the function returns the default ASCII-capable keyboard layout chosen by Setup Assistant.

TextInputSourceMBS.CurrentASCIICapableKeyboardLayoutInputSource as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the most recently used ASCII-capable keyboard layout.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.CurrentASCIICapableKeyboardLayoutInputSource

MsgBox t.LocalizedName

Returns A text input source reference for the most recently used ASCII-capable keyboard layout.

If no ASCII-capable keyboard input source has been used, the function returns the default ASCII-capable keyboard layout chosen by Setup Assistant.

This function is used by input methods to get the keyboard layout used for key translation if no specific keyboard layout override exists. The CurrentASCIICapableKeyboardInputSource can return input sources that are not keyboard layouts.

TextInputSourceMBS.CurrentKeyboardInputSource as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the currently selected keyboard input source.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.CurrentKeyboardInputSource
MsgBox t.LocalizedName

TextInputSourceMBS.CurrentKeyboardLayoutInputSource as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the keyboard layout currently in use.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.CurrentKeyboardLayoutInputSource
MsgBox t.LocalizedName

If the currently selected keyboard input source is a keyboard layout, the text input source reference refers to that layout. If the currently selected keyboard input source is an input method or mode, the text input source reference refers to the keyboard layout used by that input method or mode.

TextInputSourceMBS.InputMethodKeyboardLayoutOverride as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the currently selected input method's keyboard layout override.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.InputMethodKeyboardLayoutOverride
if t = nil then
MsgBox "Nil"
else
MsgBox t.LocalizedName
end if

If the current keyboard input source is an input method or mode that has a keyboard layout override, a text input source reference for that keyboard layout is returned. Otherwise, the function returns nil.

TextInputSourceMBS.InputSourceForLanguage(language as string) as TextInputSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a text input source reference for the input source that should be used to input the specified language.

language: A BCP 47 language code (in the same form returned by the Core Foundation function CFLocaleCreateCanonicalLanguageIdentifierFromString function) that represents the language an input source should be returned for.

Returns an enabled input source that can input the specified language. If more than one such input source exists and at least one has been used, the most recently used input source is chosen. If none has been used, one is chosen based on the intended languages of the input sources. If no enabled input source exists that can input the specified language, the function returns nil.

If a text field is expected to have input in a particular language, an application can call InputSourceForLanguage and then SelectIt to select an input source appropriate for that language. This function is a replacement for the deprecated KeyScript programming interface's capability to select the default input source associated with a particular script code.

TextInputSourceMBS.kTISCategoryInkInputSource as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the category identifiers.

You can install or select 0 or 1 ink input source.

Some examples using this method:

TextInputSourceMBS.kTISCategoryKeyboardInputSource as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the category identifiers.

This category includes keyboard layouts, keyboard input methods (both with modes and without), and keyboard input modes. At least one input source in this category is installed. Of all input sources in this category, exactly one is selected; selecting a new one deselects the previous one.

Some examples using this method:

TextInputSourceMBS.kTISCategoryPaletteInputSource as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the category identifiers.

This category includes character palettes and keyboard viewers. You can select 0 or more categories.

Some examples using this method:

TextInputSourceMBS.kTISNotifyEnabledKeyboardInputSourcesChanged as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The name of the CF distributed notification for a change to the set of enabled keyboard input sources.

Available in OS X v10.5 and later.

TextInputSourceMBS.kTISNotifySelectedKeyboardInputSourceChanged as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The name of the CF distributed notification for a change to the selected keyboard input source.

Available in OS X v10.5 and later.

TextInputSourceMBS.kTISPropertyBundleID as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a string for the reverse DNS BundleID associated with the input source.

TextInputSourceMBS.kTISPropertyIconImageURL as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a CFURLRef indicating the file containing the image (typically TIFF) to be used as the input source icon.
If an image file URL is not available for the specified input source, the value is nil. Note that other image formats (for example, JPEG, PNG) may also be used in the future.
Note: You may not use this key (and its corresponding value) used in the filter dictionary passed to the CreateInputSourceList function.

TextInputSourceMBS.kTISPropertyIconRef as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is an IconRef value for the input source icon.
Icon references are the typical icon format for keyboard layouts and input methods. If an icon reference is not available for the specified input source, the value is nil.
Note: You may not use this key (and its corresponding value) used in the filter dictionary passed to the CreateInputSourceList function.

TextInputSourceMBS.kTISPropertyInputModeID as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a CFStringRef for a reverse DNS string that identifies a particular usage class for input modes.
For example, com.apple.inputmethod.Japanese.Katakana identifies a standard Katakana-input usage class that may be associated with input modes from several different input methods.
You can attach this input mode to a TSMDocument using the TSMSetDocumentProperty function with the tag kTSMDocumentInputModePropertyTag, to control the input mode usage class that should be used with that TSM document.

TextInputSourceMBS.kTISPropertyInputSourceCategory as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a string indicating the category of an input source.
Possible values are specified by the following property value constants: kTISCategoryKeyboardInputSource, kTISCategoryPaletteInputSource, and kTISCategoryInkInputSource.

TextInputSourceMBS.kTISPropertyInputSourceID as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.
Example
// show keyboard viewer
Dim d As New Dictionary
d.Value(TextInputSourceMBS.kTISPropertyInputSourceID) = "com.apple.KeyboardViewer"

Dim sources() As TextInputSourceMBS = TextInputSourceMBS.CreateInputSourceList(d, False)
If UBound(Sources) >= 0 Then
sources(0).SelectIt
End If

This property key designates a property value, which is a CFStringRef for the unique reverse DNS name associated with the input source.

  • For keyboard input methods and for palette or ink input sources, typically, the bundle ID, for instance, com.apple.Kotoeri.
  • For keyboard input modes, typically, the bundle ID of the parent input method plus a suffix that uniquely identifies the input mode, for instance, com.apple.Kotoeri.Katakana. It is not the generic input mode name used across input methods, for instance, com.apple.inputmethod.Japanese.Katakana.
  • For keyboard layouts, a new identification mechanism typically structured as com.company.keyboardlayout.name,for instance, com.apple.keyboardlayout.US.

TextInputSourceMBS.kTISPropertyInputSourceIsASCIICapable as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a boolean indicating whether the input source is intended to be capable of ASCII input.

TextInputSourceMBS.kTISPropertyInputSourceIsEnableCapable as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value which is a boolean indicating whether the input source can ever be programmatically enabled using TISEnableInputSource.
You can enable most input sources programmatically at any time. kTISPropertyInputSourceIsEnableCapable is set to true for these input sources.
Some input sources can never be programmatically enabled. These are mainly input method private keyboard layouts used by the input method via the functionTISSetInputMethodKeyboardLayoutOverride. You cannot directly enable these layouts, nor use them as keyboard layout input sources. kTISPropertyInputSourceIsEnableCapable is set to false for these.
Some input sources can be programmatically enabled only under the correct conditions. These are mainly input modes, which can be changed from disabled to enabled only if their parent input method is enabled. However, they can already be in the enabled state, but not currently selectable if their parent input method is disabled. kTISPropertyInputSourceIsEnableCapable is true for these.

TextInputSourceMBS.kTISPropertyInputSourceIsEnabled as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a boolean indicating whether the input source is currently enabled.

TextInputSourceMBS.kTISPropertyInputSourceIsSelectCapable as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a boolean indicating whether the input source can ever be programmatically selected using TISSelectInputSource.
This static property of an input source does not depend on any current state. For input sources that can be programmatically selected if they are enabled, kTISPropertyInputSourceIsSelectCapable is set to true.
For input sources that can never be programmatically selected even if they are enabled, kTISPropertyInputSourceIsSelectCapable is set to false. Such sources are mainly input methods that have modes (parent input methods); only their modes can be selected.
For input sources that are enabled and can only be programmatically selected under the correct conditions, kTISPropertyInputSourceIsSelectCapable is set to true. Such input sources are mainly input modes, which can only be selected if both they and their parent input method are enabled.
For input sources that can never be enabled or selected, kTISPropertyInputSourceIsSelectCapable is set to false.

TextInputSourceMBS.kTISPropertyInputSourceIsSelected as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a Boolean indicating whether the input source is currently selected.

TextInputSourceMBS.kTISPropertyInputSourceLanguages as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a CFArrayRef for an array of CFStringRefs, where each string is the language code for a language that can be input using the input source. You can use this constant with the PropertyValue function, but you may not use it in the filter dictionary passed to the CreateInputSourceList function.
Languages codes are in the same BCP 47 form returned by the CFLocaleCreateCanonicalLanguageIdentifierFromString function. The first language code in the array is the language the input source is intended for. If no such language exists (for example, for the Unicode Hex Input keyboard layout), the first language code is an empty string.

TextInputSourceMBS.kTISPropertyInputSourceType as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a string indicating the specific type of an input source.
Possible values are specified by the following property value constants: kTISTypeKeyboardLayout, kTISTypeKeyboardInputMethodWithoutModes, kTISTypeKeyboardInputMethodModeEnabled, kTISTypeKeyboardInputMode, kTISTypeCharacterPalette, kTISTypeKeyboardViewer, and kTISTypeInk.

TextInputSourceMBS.kTISPropertyLocalizedName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.
Example
dim t as TextInputSourceMBS
t = TextInputSourceMBS.CurrentKeyboardInputSource
MsgBox t.PropertyValue(t.kTISPropertyLocalizedName)

This property key designates a property value, which is a string for the input source's localized name as intended for user interface use.
Uses the best match (determined by CFBundle) between the localization used by the caller and the available localizations of the input source name. In some cases, this might be an unlocalized name.

TextInputSourceMBS.kTISPropertyUnicodeKeyLayoutData as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the property keys.

This property key designates a property value, which is a Memoryblock that refers to the 'uchr' keyboard layout data for a keyboard layout input source.
The 'uchr' data is in native-endian order. If the input source is not a keyboard layout, or is a keyboard layout for which only 'KCHR data' is available, the value is nil.
Note: You may not use this key (and its corresponding value) used in the filter dictionary passed to the CreateInputSourceList function.

TextInputSourceMBS.kTISTypeCharacterPalette as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryPaletteInputSource.

TextInputSourceMBS.kTISTypeInk as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryInkInputSource. Even though it is the only type in that category, a type is provided so that clients who don't need category information can just check input source type.

TextInputSourceMBS.kTISTypeKeyboardInputMethodModeEnabled as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryKeyboardInputSource.

TextInputSourceMBS.kTISTypeKeyboardInputMethodWithoutModes as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryKeyboardInputSource.

TextInputSourceMBS.kTISTypeKeyboardInputMode as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryKeyboardInputSource.

TextInputSourceMBS.kTISTypeKeyboardLayout as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryKeyboardInputSource.

TextInputSourceMBS.kTISTypeKeyboardViewer as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the possible type values.

This type belongs to the category kTISCategoryPaletteInputSource.

TextInputSourceMBS.RegisterInputSource(file as folderitem) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Registers any new input sources in a file or bundle so a text input source reference can be obtained immediately for each new input source.

location: The location of the input sources in a file or bundle.

Returns a result code. The function returns paramErr (-50) if location is invalid or the input sources in the specified location cannot be registered. Otherwise, it returns noErr (0).

This function enables an installer for an input method bundle or a keyboard layout file or bundle to notify the system to register these new input sources. The system can then locate the specified file or bundle and perform any necessary cache rebuilds so that the installer can immediately call TISCreateInputSourceList with appropriate properties (for example, a bundle ID or input source ID) to get text input source references for one or more of the newly registered input sources.

You can only use this function to register the following:

Keyboard layout files or bundles in the /Library/Keyboard Layouts/ or ~/Library/Keyboard Layouts/ directory (available to all users or to the current user, respectively). Such keyboard layouts, once enabled, are selectable.
Input method bundles in the new Library/Input Methods/ or ~/Library/Input Methods/ directories (available to all users or to the current user, respectively).
Note: Input method bundles can include private non-selectable keyboard layouts for use with SetInputMethodKeyboardLayoutOverride. These are registered automatically when the input method is registered, and do not need to be separately registered. They are not registered using TISRegisterInputSource.
Security: Any code that calls RegisterInputSource is part of an application or service that has already been validated in some way (for instance, by the user).

See also:

TextInputSourceMBS.RegisterInputSource(URL as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Mac MBS MacOSX Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Registers any new input sources in a file or bundle so a text input source reference can be obtained immediately for each new input source.

location: The location of the input sources in a file or bundle.

Returns a result code. The function returns paramErr (-50) if location is invalid or the input sources in the specified location cannot be registered. Otherwise, it returns noErr (0).

This function enables an installer for an input method bundle or a keyboard layout file or bundle to notify the system to register these new input sources. The system can then locate the specified file or bundle and perform any necessary cache rebuilds so that the installer can immediately call TISCreateInputSourceList with appropriate properties (for example, a bundle ID or input source ID) to get text input source references for one or more of the newly registered input sources.

You can only use this function to register the following:

Keyboard layout files or bundles in the /Library/Keyboard Layouts/ or ~/Library/Keyboard Layouts/ directory (available to all users or to the current user, respectively). Such keyboard layouts, once enabled, are selectable.
Input method bundles in the new Library/Input Methods/ or ~/Library/Input Methods/ directories (available to all users or to the current user, respectively).
Note: Input method bundles can include private non-selectable keyboard layouts for use with SetInputMethodKeyboardLayoutOverride. These are registered automatically when the input method is registered, and do not need to be separately registered. They are not registered using TISRegisterInputSource.
Security: Any code that calls RegisterInputSource is part of an application or service that has already been validated in some way (for instance, by the user).

See also:

The items on this page are in the following plugins: MBS MacOSX Plugin.


The biggest plugin in space...