Menu
Home
Create new Paste
Log in
Code
Theme: cobalt
Theme: eclipse
Theme: elegant
Theme: monokai
Theme: neat
Theme: night
Theme: rubyblue
version(Posix) { import core.sys.posix.termios; import core.stdc.stdio; } else version(Windows) { import core.sys.windows.windows; extern (C) int _getch(); } char readKey() { version(Posix) { int getch() { int ch; termios oldt; termios newt; tcgetattr(0, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr(0, TCSANOW, &newt); ch = getchar(); tcsetattr(0, TCSANOW, &oldt); return ch; } } else version(Windows) { alias _getch getch; } return cast(char) getch(); } import std.stdio; void main() { writeln(readKey()); }
Result:
Success
/
Return code: 0
/
Compilation time:
0.422
seconds
/
Run time:
0.022
seconds
Application output:
b
Application input:
bdc
Username
Message
Add comment
Paste info
Author:
nazriel
Views:
173
Private:
no
Expires:
Never
Uploaded:
27.09.12 7:32
Votes
:
1
Tweet
Compilation
Compiler:
GDC 2.060
Pointer size:
m64
Actions
Download
Fork
Raw
×
Confirm
Are you sure you want to delete this paste?
There's no way back!
×
Confirm
Reason