Skip to content

Commit

Permalink
shift modifiers added to keyboard help content, see phetsims/gravity-…
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarlow12 committed Oct 31, 2018
1 parent 0eb24a8 commit 724b286
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions gravity-force-lab-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"moveSphereLabel": {
"value": "Move sphere"
},
"moveInSmallerSteps": {
"value": "Move in smaller steps"
},
"moveInLargerSteps": {
"value": "Move in larger steps"
},
Expand All @@ -47,6 +50,9 @@
"changeMassInLargerSteps": {
"value": "Change mass in larger steps"
},
"changeMassInSmallerSteps": {
"value": "Change mass in smaller steps"
},
"jumpToMaximumMass": {
"value": "Jump to maximum mass"
},
Expand Down
6 changes: 6 additions & 0 deletions js/gravity-force-lab/GravityForceLabA11yStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ define( require => {
moveSphereDescription: {
value: 'Move sphere left and right with the Left and Right Arrow keys.'
},
moveInSmallerStepsDescription: {
value: 'Move in smaller steps with shift plus arrow keys.'
},
moveInLargerStepsDescription: {
value: 'Move in larger steps with Page Up and Page Down keys.'
},
Expand All @@ -116,6 +119,9 @@ define( require => {
changeMassInLargerStepsDescription: {
value: 'Change mass in larger steps with Page Up and Page Down keys.'
},
changeMassInSmallerStepsDescription: {
value: 'Change mass in smaller steps with shift plus arrow keys.'
},
jumpToMaximumMassDescription: {
value: 'Jump to maximum mass with End key.'
},
Expand Down
16 changes: 14 additions & 2 deletions js/gravity-force-lab/view/GravityForceLabKeyboardHelpContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,28 @@ define( function( require ) {
// strings
var changeMassHeadingString = require( 'string!GRAVITY_FORCE_LAB/changeMassHeading' );
var changeMassInLargerStepsString = require( 'string!GRAVITY_FORCE_LAB/changeMassInLargerSteps' );
var changeMassInSmallerStepsString = require( 'string!GRAVITY_FORCE_LAB/changeMassInSmallerSteps' );
var decreaseMassString = require( 'string!GRAVITY_FORCE_LAB/decreaseMass' );
var increaseMassString = require( 'string!GRAVITY_FORCE_LAB/increaseMass' );
var jumpToLeftString = require( 'string!GRAVITY_FORCE_LAB/jumpToLeft' );
var jumpToMaximumMassString = require( 'string!GRAVITY_FORCE_LAB/jumpToMaximumMass' );
var jumpToMinimumMassString = require( 'string!GRAVITY_FORCE_LAB/jumpToMinimumMass' );
var jumpToRightString = require( 'string!GRAVITY_FORCE_LAB/jumpToRight' );
var moveInSmallerStepsString = require( 'string!GRAVITY_FORCE_LAB/moveInSmallerSteps' );
var moveInLargerStepsString = require( 'string!GRAVITY_FORCE_LAB/moveInLargerSteps' );
var moveSphereLabelString = require( 'string!GRAVITY_FORCE_LAB/moveSphereLabel' );
var moveSpheresHeadingString = require( 'string!GRAVITY_FORCE_LAB/moveSpheresHeading' );

// a11y strings
var moveSphereDescriptionString = GravityForceLabA11yStrings.moveSphereDescription.value;
var moveInSmallerStepsDescriptionString = GravityForceLabA11yStrings.moveInSmallerStepsDescription.value;
var moveInLargerStepsDescriptionString = GravityForceLabA11yStrings.moveInLargerStepsDescription.value;
var jumpToLeftDescriptionString = GravityForceLabA11yStrings.jumpToLeftDescription.value;
var jumpToRightDescriptionString = GravityForceLabA11yStrings.jumpToRightDescription.value;
var increaseMassDescriptionString = GravityForceLabA11yStrings.increaseMassDescription.value;
var decreaseMassDescriptionString = GravityForceLabA11yStrings.decreaseMassDescription.value;
var changeMassInLargerStepsDescriptionString = GravityForceLabA11yStrings.changeMassInLargerStepsDescription.value;
var changeMassInSmallerStepsDescriptionString = GravityForceLabA11yStrings.changeMassInSmallerStepsDescription.value;
var jumpToMaximumMassDescriptionString = GravityForceLabA11yStrings.jumpToMaximumMassDescription.value;
var jumpToMinimumMassDescriptionString = GravityForceLabA11yStrings.jumpToMinimumMassDescription.value;

Expand Down Expand Up @@ -71,6 +75,12 @@ define( function( require ) {
},
pageUpPageDown: function() {
return HelpContent.pageUpPageDownRowIcon();
},
shiftPlusArrows: function() {
return HelpContent.shiftPlusIcon( HelpContent.leftRightArrowKeysRowIcon() );
},
shiftPlusAllArrows: function() {
return HelpContent.shiftPlusIcon( HelpContent.arrowKeysRowIcon() );
}
};

Expand All @@ -86,6 +96,7 @@ define( function( require ) {
// move mass content
var moveMassRow = this.constructRow( moveSphereLabelString, moveSphereDescriptionString, 'leftRight' );

var moveSmallStepsRow = this.constructRow( moveInSmallerStepsString, moveInSmallerStepsDescriptionString, 'shiftPlusArrows' );
// 'move in larger steps' content
var moveLargeStepsRow = this.constructRow( moveInLargerStepsString, moveInLargerStepsDescriptionString, 'pageUpPageDown' );

Expand All @@ -95,17 +106,18 @@ define( function( require ) {
// 'jump to right' content
var jumpRightRow = this.constructRow( jumpToRightString, jumpToRightDescriptionString, 'end' );

var moveMassRows = [ moveMassRow, moveLargeStepsRow, jumpLeftRow, jumpRightRow ];
var moveMassRows = [ moveMassRow, moveSmallStepsRow, moveLargeStepsRow, jumpLeftRow, jumpRightRow ];
var moveMassHelpContent = new HelpContent( moveSpheresHeadingString, moveMassRows );

// Mass adjustment help section
var increaseMassRow = this.constructRow( increaseMassString, increaseMassDescriptionString, 'upOrRight' );
var decreaseMassRow = this.constructRow( decreaseMassString, decreaseMassDescriptionString, 'downOrLeft' );
var changeMassSmallStepsRow = this.constructRow( changeMassInSmallerStepsString, changeMassInSmallerStepsDescriptionString, 'shiftPlusAllArrows' );
var changeMassLargeStepsRow = this.constructRow( changeMassInLargerStepsString, changeMassInLargerStepsDescriptionString, 'pageUpPageDown' );
var jumpToMinMassRow = this.constructRow( jumpToMinimumMassString, jumpToMinimumMassDescriptionString, 'home' );
var jumpToMaxMassRow = this.constructRow( jumpToMaximumMassString, jumpToMaximumMassDescriptionString, 'end' );

var adjustMassRows = [ increaseMassRow, decreaseMassRow, changeMassLargeStepsRow, jumpToMinMassRow, jumpToMaxMassRow ];
var adjustMassRows = [ increaseMassRow, decreaseMassRow, changeMassSmallStepsRow, changeMassLargeStepsRow, jumpToMinMassRow, jumpToMaxMassRow ];
var adjustMassHelpContent = new HelpContent( changeMassHeadingString, adjustMassRows );

// align icons for the mass movement and adjustment sections
Expand Down

0 comments on commit 724b286

Please sign in to comment.