www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Raw keyboard input

reply "DLearner" <bmqazwsx123 gmail.com> writes:
Hi,

Please, under Debian / GDC, what functions are available to read 
keys directly as pressed (no wait for <Enter>)?

And how used (infinite loop exited on specific keycode, eg for 
'Esc')?
Aug 16 2013
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sat, Aug 17, 2013 at 01:21:13AM +0200, DLearner wrote:
 Hi,
 
 Please, under Debian / GDC, what functions are available to read
 keys directly as pressed (no wait for <Enter>)?
 
 And how used (infinite loop exited on specific keycode, eg for
 'Esc')?
Currently, Phobos doesn't have this capability, but Adam Ruppe has written a Terminal struct that you can use not just for reading input, but for basic terminal manipulation as well: https://github.com/robik/ConsoleD/blob/master/terminal.d Check out the example code in the main() function near the bottom of the file. T -- Written on the window of a clothing store: No shirt, no shoes, no service.
Aug 16 2013