 // deals with a keypress
 void keypress(int val)
 {
-	// keep showing last value until next keypress
-	if (index == 0) { keyStroke = 0; }
-	keyStroke += val << index;
-	index++;
-	if (index > 7)
-	{
-		//Keyboard.write((char)keyStroke);
-		sendVal((char)keyStroke);
-		index = 0;
-	}
+
+	if (USE_RIGHT_TO_LEFT)
+	{
+		// clear the keystroke only when starting to type once again
+		if (index == 0) { keyStroke = 0; }
+
+		keyStroke += val << index;
+		// index increments from 0 -> 7 when RTL
+		index++;
+
+		if (index > 7)
+		{
+			sendVal((char)keyStroke);
+			index = 0;
+		}
+	}
+	else
+	{
+		// clear the keystroke only when starting to type once again
+		if (index == 7) { keyStroke = 0; }
+
+		keyStroke += (val << index);
+		
+		// index decrements from 0->7 when LTR
+		index--;
+
+		if (index < 0)
+		{
+			sendVal((char)keyStroke);
+			index = 7;
+		}
+	}
+
+	
 }
 
 void sendVal(char val)

	display.clearDisplay();
	display.setCursor(0, 0);
	display.setTextColor(WHITE);
	display.print("Binary Keyboard!\n by Chris Johnston");
	display.display();
	delay(1000);
	// wipes the screen away with an effect

int ledDecayRate = 10;

void setup() {

	if (USE_RIGHT_TO_LEFT)
	{
		index = 0;
	}
	else
	{
		index = 7;
	}

	//Serial.begin(9600);
	Keyboard.begin();

