Typing with scrambled keys
CJam, 31 27 25 24 bytes
l:A;lel:N{_A_$er_N#}g;],

Takes input in the form of:
aebcdjfghiqklmnopzrstuvwxy
Mr. John Doe

i.e. first line - alphabets, second line - name.
How it works:
l:A;lel:N{_A_$er_N#}g;],
l:A;                         &quot;Read the alphabets from the 1st line in A and pop from stack&quot;;
    lel:N                    &quot;Read the name in small caps from 2nd line and store in N&quot;;
         {         }g        &quot;Run a while loop until we have the original name back again&quot;;
          _                  &quot;Put a dummy string on stack just to keep count of times&quot;;
           A                 &quot;Put the alphabets on stack&quot;;
            _$               &quot;Copy them and sort the copy to get the correct order&quot;;
              er             &quot;Transliterate the right keys with the wrong ones&quot;;
                _N#          &quot;Copy the result and see if its equal to the original name&quot;;
                     ;]      &quot;Pop the last name and wrap everything in an array&quot;;
                       ,     &quot;Get the length now. Since we were putting a dummy string&quot;;
                             &quot;on stack in each iteration of the while loop, this length&quot;;
                             &quot;represents the number of times we tried typing the name&quot;;

Try it online here