Adjacent Letter Test

Pyth - 66 62 60 bytes

Pretty straightforward approach. Checks if any of substrings len 3 are in any of the rotations of the keyboard. Will be using base encoding for keyboard.

.E}Rjb+J+Kc+jkS9"0
qwertyuiop
asdfghjkl
zxcvbnm"b.tKN_MJ.:z3

Test Suite.


Japt, 78 bytes

Japt is a shortened version of JavaScript. Interpreter

V=1oA ¬+`0\nqØÆyuiop\n?dfghjkl \nzxcvbnm`;1+¡Y©(((VbX -VbUgY-1)-5 a -5 %A a)bB

Outputs 0 for falsey cases; otherwise, a positive integer. The ? should be replaced with the unprintable Unicode char U+0086, or if you don't want to go to all that trouble, just as.

How it works

V=1oA q +"0\nqwertyuiop\nasdfghjkl \nzxcvbnm";1+Um@Y&&(((VbX -VbUgY-1)-5 a -5 %A a)bB
           // Implicit: U = input string
V=1oA q    // Set variable V to the digits 1-9, plus
+"...";    // this string.
Um@        // Take U and map each character X and its index Y with this function:
Y&&        //  If Y is 0, return Y; otherwise,
VbX -      //  take the index of X in V, subtract
VbUgY-1    //  the index of (char at position Y - 1 in U) in V,
-5 a -5    //  subtract 5, take the absolute value, subtract 5 again,
%A a       //  take modulo by 10, then take the absolute value.
           //  This returns 1 for any pair of characters that is adjacent
           //  within V, horizontally or vertically.
bB +1      // Take the index of 11 in the result and add one.
           // Implicit: output last expression

C#, 227

int h(string k){var q="1234567890,QWERTYUIOP,ASDFGHJKL,ZXCVBNM,1QAZ,2WSX,3EDC,4RFV,5TGB,6YHN,7UJM,8IK,9OL,";int i=0,j=0;for(;i<k.Length-2;i++)if((q+String.Concat(Enumerable.Reverse(q))).Contains(k.Substring(i,3)))j=1;return j;}

0 is falsey, 1 is truthy. Concatenated all keys horizontal and vertical, and reversed, and checks if any of 3 chars of input is contained within.

C# is really verbose, gotta dive into other languages :(