Browse files

Fix the keyboard navigation which was broken in flipped orientations

When orientation is HorizontalFlipped, reverse the meaning of a and d
keys.  When orientation is VerticalFlipped, reverse the meaning of w
and s keys.

I decided that  making the change in the key handling code in
insertText:(NSString*)theText was more intuitive than actually changing
the meaning of left, right, up, and down in the move* methods.

My original intent with the flipped layout code was to make the change
as noninvasive as possible, this change is in keeping with that goal.
  • Loading branch information...
1 parent cb6bcdd commit 562b899f3216b98e22498297a945c12730df0e34 Chad Koski committed Aug 21, 2012
Showing with 20 additions and 4 deletions.
  1. +20 −4 PSTreeGraphView/PSBaseTreeGraphView.m
View
24 PSTreeGraphView/PSBaseTreeGraphView.m
@@ -932,16 +932,32 @@ - (void) insertText:(NSString *)theText
[self toggleExpansionOfSelectedModelNodes:self];
break;
case 'w':
- [self moveUp:self];
+ if (self.treeGraphOrientation == PSTreeGraphOrientationStyleVerticalFlipped ) {
+ [self moveDown:self];
+ } else {
+ [self moveUp:self];
+ }
break;
case 'a':
- [self moveLeft:self];
+ if (self.treeGraphOrientation == PSTreeGraphOrientationStyleHorizontalFlipped ) {
+ [self moveRight:self];
+ } else {
+ [self moveLeft:self];
+ }
break;
case 's':
- [self moveDown:self];
+ if (self.treeGraphOrientation == PSTreeGraphOrientationStyleVerticalFlipped ) {
+ [self moveUp:self];
+ } else {
+ [self moveDown:self];
+ }
break;
case 'd':
- [self moveRight:self];
+ if (self.treeGraphOrientation == PSTreeGraphOrientationStyleHorizontalFlipped ) {
+ [self moveLeft:self];
+ } else {
+ [self moveRight:self];
+ }
break;
default:

0 comments on commit 562b899

Please sign in to comment.