Crude but working parsing of arrow keys