Skip to content

Loading…

Fixed keyboard navigation in flipped orientations #20

Merged
merged 1 commit into from

2 participants

@cekoski

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.

Chad Koski 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.
562b899
@epreston epreston merged commit 3e8a407 into epreston:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 21, 2012
  1. Fix the keyboard navigation which was broken in flipped orientations

    Chad Koski committed
    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.
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:
Something went wrong with that request. Please try again.