They might deduce the keyboard from Client IP / Accept-Language-Header and such and correlate that with the default keyboard layout of the respective country the request comes from. Of course with that approach there might be false positives, e.g. somebody in a qwertz country using a querty keyboard. Is their method 100% accurate?

Here's how I'd do it:

# keyboard sequence (qwertz), for request from germany my $k = <<EOH; 1234567890ß' !"§$%&/()=?` qwertzuiopü+ asdfghjklöä# <yxcvbnm,.- >YXCVBNM;:_ EOH my @k = split/\n/,$k; # update: strings for diagonal mapping, e.g 1qa 2ws 3ed # the other diagonal is left as an exercise to the reader push @k, map { my $i=$_ ;join('',map{substr($k[$_],$_>3? $i+1:$i,1)} 0 +,2..4) } 0..11; push @k, map { my $i=$_ ;join('',map{substr($k[$_],$_>3? $i+1:$i,1)} 1 +..3,5) } 0..11; my @matches; chop (my $seq = <STDIN>); for my $i(0..length($seq) - 3) { my $t = substr($seq,$i,3); push @matches, /$t/ig for @k; } print "matches: @matches\n"; __END__ djuriops>yxcvatgb5 matches: iop >YX yxc YXC xcv XCV tgb tgB

--shmem

update: added diagonal match

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re: Keys beside keys on keyboards by shmem
in thread Keys beside keys on keyboards by Smaug

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.