Sticky Keys Panel
Overview
Component Name: gpii.firstDiscovery.panel.keyboard
File: panels.js
The Sticky Keys panel presents an adjuster that allows the user to adjust the sticky preference settings.
The Sticky Keys panel:
- assesses whether the user needs the assistance of the Sticky Keys feature,
- provides a means for users to experiment the experience when the Sticky Keys preference is turned on or off, and
- turns the Sticky Keys preference on or off.
Using the Sticky Keys Panel
Option 1: In the
Auxiliary Schema,
specify the name of the panel as the type
property of the panel
section:
"keyboard": {
"type": "gpii.firstDiscovery.stickyKeys",
"panel": {
"type": "gpii.firstDiscovery.panel.keyboard",
"container": ".gpiic-fd-prefsEditor-panel-keyboard",
"template": "%templatePrefix/keyboard.html",
"message": "%messagePrefix/keyboard.json",
"gradeNames": ["gpii.firstDiscovery.panel.keyboardTts", "gpii.firstDiscovery.panel.keyboard.prefEditorConnection"],
"keyboardInputGradeNames": ["gpii.firstDiscovery.keyboardInputTts"]
}
}
Working in conjunction with the Auxiliary Schema, the type and its default value of the Sticky Keys preference are defined in the Primary Schema:
fluid.defaults("gpii.firstDiscovery.schemas.stickyKeys", {
gradeNames: ["fluid.prefs.schemas"],
schema: {
"gpii.firstDiscovery.stickyKeys": {
"type": "boolean",
"default": false
}
}
});
Option 2: Outside the context of the First Discovery Tool, developers may wish to create a standalone component:
var myPanel = gpii.firstDiscovery.panel.keyboard(container, options);
Grades
This component uses the following base grades:
Model
This component supports the following model properties:
Path | Description | Values | Default |
---|---|---|---|
offerAssistance |
Whether or not the sticky keys feature should be offered. | Boolean | undefined |
tryAccommodation |
Whether or not users select to try the sticky keys feature. | Boolean | false |
userInput |
The user input. | String | "" |
Supported Events
This component supports the following events:
Event | Type | Description | Parameters |
---|---|---|---|
onOfferAssistance |
default | Fired when the sticky keys feature is determined to be offered. | none |
onInitInput |
default | Fired when it's time to initialize the keyboard input sub-component. | none |
Methods
Method | Description | Parameters |
---|---|---|
toggleAssistance |
Displays or hides the sticky keys assessment container. | offerAssistance (boolean): a flag indicating whether or not to display the container |
destroyAssessor |
Destroys the sticky keys assessment component. | none |
Subcomponents
This component has the following subcomponents:
Name | Description | Values | Default |
---|---|---|---|
assistance |
Used to turn on/off the sticky keys assistance. | "gpii.firstDiscovery.keyboard.stickyKeysAdjuster" |
|
stickyKeysAssessor |
Used to assess whether the user needs the help of the sticky keys feature. | "gpii.firstDiscovery.keyboard.stickyKeysAssessment" |
|
keyboardInput |
Used for the user input. | "gpii.firstDiscovery.keyboardInput" |
|
Options
This component can be configured using the following options:
Name | Description | Values | Default |
---|---|---|---|
selectors |
Javascript object containing selectors for various fragments of the markup, including the containers for the subcomponents. | See Selectors below |
Selectors
One of the options that can be provided to Infusion components is a set of CSS-based selectors identifying where in the DOM different elements can be found. Components use a DOM Binder to access the named elements.
The value for the selectors
option is itself a Javascript object containing name/value pairs:
selectors: {
selector1Name: "selector 1 string",
selector2Name: "selector 2 string",
...
}
Selector Name | Description | Default |
---|---|---|
input |
The input field. | ".gpiic-fd-keyboard-input" |
instructions |
The panel instruction. | ".gpiic-fd-keyboard-instructions" |
assistance |
The area for assessing and experimenting the sticky keys feature. | ".gpiic-fd-keyboard-assistance" |
Dependencies
<script type="text/javascript" src="src/lib/infusion/infusion-custom.js"></script>
<script type="text/javascript" src="src/js/msgLookup.js"></script>
<script type="text/javascript" src="src/js/tooltip.js"></script>
<script type="text/javascript" src="src/js/panels.js"></script>