Background
You've been given a task to take notes for a meeting. You start typing on your Google Doc, but you don't have enough time during the meeting to look at your keyboard while you type.
Fortunately for you, you can type without looking at your keyboard. After the meeting, you realize that everything you typed was one key to the left.
The Challenge
For this challenge, you will be using the letters, numbers, and space bar of the QWERTY keyboard layout.
Given an input of text (from any standard input method), output the resulting text, where every character is moved one to the left on the keyboard.
For the majority of letters, just look at the letter and translate it to the letter to the left (
c
becomesx
,t
becomesr
, etc).For letter
q
, translate to a literal tab character (\t
).For letter
a
, enable caps lock, so the capitalization of the rest of the string is reversed.For letter
z
, capitalize the next letter in the string.No translation is required for the space bar.
Preserve capitalization while translating, and be mindful of caps lock (if caps lock is enabled, make sure the case is the opposite).
All characters in the input string will be letters, numbers, or a space. No punctuation or other characters can be included.
Test Cases
\t
is a literal tab character
Hello world -> Gwkki qieks
Code Golf -> Xisw Fikd
Queried apples -> \tyweuws OOKWA
Scoring
Lowest score in bytes wins. Have fun!
Azerty
->wERT
\$\endgroup\$z
, capitalize the next letter in the string -> does that mean that we only have to care about letter capitalization and don't have to toggle between digits and symbols? What's the expected output for0123456789
,a0123456789
andz0z1z2z3z4z5z6z7z8z9
? (Besides, on many non-QWERTY keyboards, 'Caps Lock' really acts as a 'Shift Lock'. I believe that QWERTY doesn't follow this pattern, but it should be specified for those of us who are not familiar with it.) \$\endgroup\$