Skip to content
This repository

Fixed keyboard navigation in flipped orientations #20

Merged
merged 1 commit into from almost 2 years ago

2 participants

Chad Koski Ed Preston
Chad Koski

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
Ed Preston epreston merged commit 3e8a407 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 21, 2012
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
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 20 additions and 4 deletions. Show diff stats Hide diff stats

  1. +20 4 PSTreeGraphView/PSBaseTreeGraphView.m
24 PSTreeGraphView/PSBaseTreeGraphView.m
@@ -932,16 +932,32 @@ - (void) insertText:(NSString *)theText
932 932 [self toggleExpansionOfSelectedModelNodes:self];
933 933 break;
934 934 case 'w':
935   - [self moveUp:self];
  935 + if (self.treeGraphOrientation == PSTreeGraphOrientationStyleVerticalFlipped ) {
  936 + [self moveDown:self];
  937 + } else {
  938 + [self moveUp:self];
  939 + }
936 940 break;
937 941 case 'a':
938   - [self moveLeft:self];
  942 + if (self.treeGraphOrientation == PSTreeGraphOrientationStyleHorizontalFlipped ) {
  943 + [self moveRight:self];
  944 + } else {
  945 + [self moveLeft:self];
  946 + }
939 947 break;
940 948 case 's':
941   - [self moveDown:self];
  949 + if (self.treeGraphOrientation == PSTreeGraphOrientationStyleVerticalFlipped ) {
  950 + [self moveUp:self];
  951 + } else {
  952 + [self moveDown:self];
  953 + }
942 954 break;
943 955 case 'd':
944   - [self moveRight:self];
  956 + if (self.treeGraphOrientation == PSTreeGraphOrientationStyleHorizontalFlipped ) {
  957 + [self moveLeft:self];
  958 + } else {
  959 + [self moveRight:self];
  960 + }
945 961 break;
946 962
947 963 default:

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.