Skip to content

TextKeyNode

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery-phet/blob/main/js/keyboard/TextKeyNode.ts for the most up-to-date information.

Overview

TextKeyNode is a KeyNode with a text icon. It has layout, spacing, and defaults for KeyNode that are suited for text.

@author Jesse Greenberg

Class TextKeyNode

import { TextKeyNode } from 'scenerystack/scenery-phet';

Constructor

new TextKeyNode( string : string | TReadOnlyProperty<string>, providedOptions? : TextKeyNodeOptions )

Instance Methods

Static Methods

getAltKeyString() : PhetioProperty<string>

Returns the correct platform dependent key string for "Alt". "Alt" on Windows, "Option" on Mac.

altOrOption( providedOptions? : KeyNodeOptions ) : KeyNode


Static factory methods for specific text strings. For brevity, these methods have the same names as their string keys. For example string_scenery_phet_key_esc_StringProperty is rendered by the esc method.


Note that this will render "Alt" OR "Options", depending on platform. If there is a description of this icon in the PDOM please use getAltKeyString().

capsLock( providedOptions? : KeyNodeOptions ) : KeyNode

esc( providedOptions? : KeyNodeOptions ) : KeyNode

end( providedOptions? : KeyNodeOptions ) : KeyNode

enter( providedOptions? : KeyNodeOptions ) : KeyNode

fn( providedOptions? : KeyNodeOptions ) : KeyNode

home( providedOptions? : KeyNodeOptions ) : KeyNode

pageDown( providedOptions? : KeyNodeOptions ) : KeyNode

pageUp( providedOptions? : KeyNodeOptions ) : KeyNode

space( providedOptions? : KeyNodeOptions ) : KeyNode

shift( providedOptions? : KeyNodeOptions ) : KeyNode

tab( providedOptions? : KeyNodeOptions ) : KeyNode

Type TextKeyNodeOptions

import type { TextKeyNodeOptions } from 'scenerystack/scenery-phet';

Source Code

See the source for TextKeyNode.ts in the scenery-phet repository.