Inherits from SLStaticElement : SLUIAElement : NSObject
Conforms to SLKeyboard
Declared in SLKeyboard.h

Overview

SLKeyboard allows you to test whether your application’s standard keyboard is visible, and type strings.

To tap individual keys on the keyboard, use SLKeyboardKey.

Tasks

  • + keyboard

    Returns an element representing the application’s keyboard.

  • – typeString:

    Taps the keys of the specified keyboard as required to generate the specified string.

Class Methods

keyboard

Returns an element representing the application’s keyboard.

+ (instancetype)keyboard

Return Value

An element representing the application’s keyboard.

Declared In

SLKeyboard.h

Instance Methods

typeString:

Taps the keys of the specified keyboard as required to generate the specified string.

- (void)typeString:(NSString *)string

Parameters

string

The string to be typed on the keyboard.

Discussion

This string may contain characters that do not appear on the keyboard in the keyboard’s current state—the keyboard will change keyplanes as necessary to make the corresponding keys visible.

Bug: This method throws an exception if string contains any characters that can be accessed only through a tap-hold gesture, for example “smart-quotes.” Note that SLTextField, SLTextView, and related classes work around this bug internally when their text contents are set with -setText:.

Declared In

SLKeyboard.h