Here's an attempt to tidy up your code and make it only react when things change... It takes up quite a bit less memory. The OLED library takes quite a bit so you could be running out with all those large arrays...
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// On an arduino UNO: A4(SDA), A5(SCL)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
const int maxInput = 100;
char InputArray[maxInput]; // stores the selected value from char Input
char Output[maxInput]; // stores the final result to show on screen
char Input[36] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; // shows value on screen and allows selection to store in char InputArray
char AlphaNumChart[6][6] = { { 'a', 'b', 'c', 'd', 'e', 'f' },
{ 'g', 'h', 'i', 'j', 'k', 'l' },
{ 'm', 'n', 'o', 'p', 'q', 'r' },
{ 's', 't', 'u', 'v', 'w', 'x' },
{ 'y', 'z', '0', '1', '2', '3' },
{ '4', '5', '6', '7', '8', '9' }
}; // based on coordinates calculated by the formula, will select characters from this matrix to store in char Output
uint8_t num[maxInput]; //indicies of InputArray
const int keyPin = 2; // key to allow selection of the value to store in char InputArray
const int selectionPin = A0; // rotary pot
int prevKeyState;
int prevSelectionState;
int prevSelectionIdx;
int InputArrayPos = 0; //this is just for word positioning on the display
void setup() {
pinMode(keyPin, INPUT);
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
display.setTextWrap(false);
display.clearDisplay();
}
void loop() {
int selectionIdx = map(analogRead(selectionPin), 0, 1023, 0, 36);
int keyState = digitalRead(keyPin);
if ( selectionIdx == prevSelectionIdx && keyState == prevKeyState ) {
// nothing has changed, so nothing to do, exit loop at try again
return;
}
// something has changed, either the character selected or the state of the key
if ( selectionIdx != prevSelectionIdx ) {
updateCharSelection(selectionIdx);
prevSelectionIdx = selectionIdx;
}
if ( keyState != prevKeyState ) {
prevKeyState = keyState;
if ( selectionIdx < 36 ) {
// process a key selection
if (keyState == HIGH) {
// key was pressed, add it to input
addCharInput(selectionIdx);
}
else {
// key was released, do nothing
}
}
else {
// deal with final "Show output" selection
if (keyState == HIGH) {
// key was pressed, show output
calculateOutput();
displayOutput();
}
else {
// key was released, do nothing
}
}
delay(20); // debounce key
}
}
void calculateOutput() {
for (int i = 0; i < InputArrayPos; i++) {
int row = num[i] / 6;
int col = num[InputArrayPos - 1 - i] % 6;
Output[i] = AlphaNumChart[row][col];
}
Output[InputArrayPos] = '\0';
}
void displayOutput() {
int CursorEnd = (-12 * InputArrayPos) + display.width();
int CursorStart = 0;
int CursorRef = 0;
while (digitalRead(keyPin) == HIGH) {
if (InputArrayPos <= 10) {
displayPrint(0, 27, WHITE, 2);
display.println(Output);
display.display();
}
else {
display.clearDisplay();
displayPrint(0, 0, WHITE, 1);
display.println("Your Output:");
displayPrint(CursorStart, 27, WHITE, 2);
display.println(Output);
display.display();
if (CursorStart == 0) {
CursorStart = CursorStart - 2;
CursorRef = 0;
delay(1000);
}
if ((CursorStart < 0) && (CursorRef == 0)) CursorStart = CursorStart - 2;
if (CursorStart == CursorEnd) {
CursorStart = CursorStart + 2;
CursorRef = 1;
delay(1000);
}
if ((CursorStart < 0) && (CursorRef == 1)) CursorStart = CursorStart + 2;
}
}
}
void displayPrint(int x, int y, int color, int size) {
display.setCursor(x, y);
display.setTextColor(color);
display.setTextSize(size);
}
void updateCharSelection(int idx) {
char ch;
bool onChar; // true when selection is on a char, false if "Show Output"
if (idx < 36) {
ch = Input[idx];
onChar = true;
}
else {
onChar = false;
}
display.clearDisplay();
if ( onChar ) {
displayPrint(0, 0, WHITE, 1);
display.println("Your selection:");
displayPrint(55, 15, WHITE, 4);
display.print(ch);
}
else {
displayPrint(0, 22, WHITE, 2);
display.println("SHOW Output");
}
displayInput();
}
void addCharInput(int idx) {
num[InputArrayPos] = idx; // store index for later computation
InputArray[InputArrayPos++] = Input[idx];
InputArray[InputArrayPos] = '\0';
if ( InputArrayPos >= maxInput - 1 ) {
InputArrayPos = maxInput - 2;
}
display.clearDisplay();
displayPrint(0, 0, WHITE, 1);
display.println("Your selection:");
displayPrint(50, 22, WHITE, 2);
display.println("OK!");
displayInput();
}
void displayInput() {
int cursor = 0;
if (InputArrayPos > 10) {
cursor = (10 - InputArrayPos) * 12;
}
displayPrint(cursor, 47, WHITE, 2);
display.println(InputArray);
display.display();
}