I get your explanation. A couple of things to note
-
the OLED display takes up a LOT of memory and it looks like you are using an UNO so you may be running out of memory.
-
You calculations on the input reduce to simply the index into the original array. a..z = 0..25 and '0'..'9' go to 26..35. That is why my code just stores the index along with the char when you press the KEY.
-
your two indices into your matrix are just counting from each end of your array.
-
What comes out on the Serial Monitor? Adding some debug statements during the calculation may help.
-
what part of the code I provided don't you understand? I simply renamed a few variables, moved a few global variables to local versions and put some code inside functions. Nothing too fancy.