g | x | w | all
Bytes Lang Time Link
093Rust240922T124726Zbzr
077JavaScript201024T193408Zbzr
057C gcc210119T181624ZanotherO
053K ngn/k201023T173311Zcoltim
079Haskell201025T170711Zlynn
038Husk201023T153431ZRazetime
035Husk201023T154711ZDominic
012Japt hR201023T141117ZShaggy
038Japt151124T153745ZETHprodu
114Hassium151130T171805ZJacob Mi
074Bash151130T162727ZSnoringF
083PHP151129T004820Zinsertus
080Bash151129T033954ZCajova_H
109Python151127T204408ZAshwin G
044TeaScript151124T171207ZETHprodu
nanBatch151126T224634ZNeil
046O 2.2151125T112248Zmanatwor
097C++151126T052938ZTas
172SQL MS TSQL151126T105438ZSteve Ma
056Perl151124T105404Zprimo
088JavaScript151124T190819Znicael
122Befunge151125T162709ZVincent
nan Ruby151124T230137Zhbejgel

Rust, 93 bytes

let f=|c:char|"q w e r t y u i o p
a s d f g h j k l
z x c v b n m".split(c).nth(1).unwrap();

Attempt This Online!

JavaScript, 77 bytes

alert(`q w e r t y u i o p
a s d f g h j k l
z x c v b n m`.split(prompt())[1])

Fiddle

C (gcc), 57 bytes

f(c){puts(strchr("qwertyuiop\nasdfghjkl\nzxcvbnm",c)+1);}

Try it online!

K (ngn/k), 53 bytes

{` 0:1_*|x\"\n"/" "/'$$`qwertyuiop`asdfghjkl`zxcvbnm}

Try it online!

Uses "\n"/" "/'$$`...`...`... to (slightly) compress "q w e r t y u i o p\na s d f g h j k l\nz x c v b n m".

It then splits that string on the input character, taking the remainder that occurs after that character.

Haskell, 79 bytes

drop 2.snd.(`span`"q w e r t y u i o p\na s d f g h j k l\nz x c v b n m").(/=)

Try it online!

Husk, 38 bytes

↓2↓≠←⁰¶mJ' ¶¨qw²yuiop₄sdfghjkl¶zxcvbnm

Try it online!

Husk, 29 35 bytes

Edit +6 bytes when I realised that the letters need to be separated by spaces

¶mJ' ¶!2x¨qw²yuiop₄sdfghjkl¶zxcvbnm

Try it online!

Japt -hR, 12 bytes

;Dv qU ®·®¬¸

Try it

Japt, 49 42 41 40 38 bytes

Japt is a shortened version of JavaScript. Interpreter

`qØÆyuiop\n?dfghjkl\nzxcvbnm`qU g1 ¬qS

The ? should be the unprintable Unicode char U+0086.

How it works

          // Implicit: U = input char
`...`     // Take the compressed string and decompress it.
qU g1     // Split the string at the input and take the second item.
¬qS       // Split into chars, then join with spaces.
          // Implicit: output final expression

Now beating CJam! :) Suggestions welcome!

Non-competing version, 12 bytes

;Dv qU g1 ¬¸

As of Jan 11, I've added a cool new feature to Japt: If the program contains a leading comma, the variables ABCDEFGHIJL are redefined to various values. D is set to "QWERTYUIOP\nASDFGHJKL\nZXCVBNM", so ;Dv is enough to replace the string here.

Hassium, 114 Bytes

func main(){k="qwertyuiop\nasdfghjkl\nzxcvbnm\n"foreach(l in k.substring(k.index(input())))print(l!="\n"?l+" ":l)}

Run online and see expanded with test case here

Bash, 74 bytes

Took a different approach than @Cajova_Houba's answer, so I posted it separately. Ended up not being too much shorter because I initially forgot to deal with space-separating the output.

cut -d"$1" -f2<<<"qwertzuiop asdfghjkl yxcvbnm"|tr ' ' "\n"|sed 's/./& /g'

Takes input as a command line argument, or just replace $1 manually and run it straight from terminal.

PHP, 83 bytes

<?=trim(explode($argv[1],"qw e r t y u i o p
a s d f g h j k l
z x c v b n m")[1]);

Takes the letter from the command line, like:

$ qwerty.php y

Bash, 80 bytes

x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*$1}|sed 's/./& /g'

Try it yourself, either replace $1 with desired character or make a #!/bin/bash script.

Here are some samples from cygwin:

$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*q}|sed 's/./& /g'
w e r t z u i o p
a s d f g h j k l
y x c v b n m

$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*m}|sed 's/./& /g'

$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*h}|sed 's/./& /g'
j k l
y x c v b n m

It's not the shortest, but I'm still proud of it!

Python, 109 bytes

I know its a bit large but its all I know how to do right now!

def kb(c): 
 s = "q w e r t y u i o p \n a s d f g h j k l \n z x c v b n m"
 a = s.split(c)
 print(a[1])

TeaScript, 50 45 44 bytes

TeaScript is JavaScript for golfing.

`qwertyuiop
asdfghjkl
zxcvbnm`.s×[1]s(b)j(p)

Ungolfed and explanation

`qwertyuiop
asdfghjkl
zxcvbnm`.s(x)[1]s(b)j(p)

      // Implicit: x = input string
`...` // Take the qwerty string,
.s(x) // and split it at the input.
[1]   // Take the second item from this,
s(b)  // split it into chars,
j(p)  // and join the result with spaces.
      // Implicit: output final expression

Batch, 206 + 2 = 208 bytes

Because this uses delayed expansion you need to invoke it with CMD /V /C keyboard.cmd <letter>, so adding 12 for the /V switch.

@echo off
set a=q w e r t y u i o p
set b=a s d f g h j k l
set c=z x c v b n m
if not "!a:*%1 =!"=="!a!" echo !a:*%1 =!
if not "!a:*%1=!!b:*%1 =!"=="!a!!b!" echo !b:*%1 =!
if not %1==m echo !c:*%1 =!

O 2.2, 48 46 characters

"qwertyuiop
asdfghjkl
zxcvbnm
"i/r;s{n.U=ST?}d

Sample run:

bash-4.3$ ./o keyboard.o <<< 'f'
g h j k l 
z x c v b n m 

O, 61 characters

"qwertyuiop\nasdfghjkl\nzxcvbnm\n"i/r;""/rl{.o"\n"={}{' o}?}d

Sample run:

bash-4.3$ java xyz.jadonfowler.o.O keyboard.o <<< 'f'
g h j k l 
z x c v b n m 

C++, 129, 112 97 bytes

#include<string>
#include<cstdio>
void o(char c){puts(strstr("qwertyuiopasdfghjklzxcvbnm",&c));}

Ungolfed:

#include<string>
#include<cstdio>
void o(char c)
{
    puts(strstr("qwertyuiopasdfghjklzxcvbnm",&c));
}

SQL (MS T-SQL), 172 bytes

CREATE PROC c @I CHAR(1) AS DECLARE @S CHAR(49) SET @S = 'w e r t y u i o p' + CHAR(13) + 'a s d f g h j k l' + CHAR(13) + 'z x c v b n m' PRINT RIGHT(@S,LEN(@S)-CHARINDEX(@I,@S))

Ungolfed:

CREATE PROC c                           -- Create a procedure named "c"
    @I CHAR(1)                          -- Which is invoked with a single character input (@I)
AS

DECLARE @S CHAR(49) = 'w e r t y u i o p' + CHAR(13) + 'a s d f g h j k l' + CHAR(13) + 'z x c v b n m' -- Initialise the entire output omitting "q " as @S
PRINT RIGHT(@S,LEN(@S)-CHARINDEX(@I,@S))    -- Use the charindex funtion to effectively substring @S

I'm new here, only just discovered this site. No idea if I've posted correctly or if T-SQL is allowed but I know the procedure above works.

Perl, 56 bytes

#!perl -p
'qwertyuiop
asdfghjkl
zxcvbnm'=~/$_
?/;$_=$';s/\B/ /g

Counting the shebang as 3, input is taken from stdin. If a leading newline isn't a concern for inputs p and l, then /$_\n?/ could be replaced with a bare $_ to save 4.


Sample Usage

$ echo g|perl qwerty.pl
h j k l
z x c v b n m

$ echo v|perl qwerty.pl
b n m

JavaScript, 88 bytes

function s(d){alert("qw e r t y u i o p\na s d f g h j k l\nz x c v b n m".split(d)[1])}

(no need in the space after the first char, as it never gets to the output)

Alerts the keyboard when you call s("some letter"). Can be also made with document.write() or console.log(), but hey, it's longer :P

Demo:

function s(d){alert("qw e r t y u i o p\na s d f g h j k l\nz x c v b n m".split(d)[1])}

s(prompt("Enter the key"));

Befunge, 122 bytes

"m n b v c x z"25*"l k j h g f d s a"v
v1-")"g2-"U"~"q w e r t y u i o p"*25<
>-:#v_$>:#,_@ZVD0FHJ:LNP^\<>,2B48X.T6R
^1$\<

It has been tested here: Befunge-93 Interpreter.

How it works

Note

I picked the encoding so the string starts with @ in order to overlap with the program. This string is generated with the following python code:

import string
letters = string.ascii_lowercase
base = 'q w e r t y u i o p a s d f g h j k l z x c v b n m'
print(''.join(chr(base.index(x) + 32 + 9 + 3) for x in letters))

Ruby, 59 57 67 bytes

Added spaces between letters

puts"qwertyuiop\nasdfghjkl\nzxcvbnm".split(gets.chop)[-1].chars*' '