# Keyboard input

**URL:** <https://rubytalk.org/t/keyboard-input/82>\
**Category:** ruby-talk\
**Created:** [4 June 2002 20:34 UTC](https://rubytalk.org/t/keyboard-input/82 "2002-06-04T20:34:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Shapiro](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@Matthew\_Shapiro](https://rubytalk.org/u/Matthew_Shapiro)\
**Post date:** [4 June 2002 20:34 UTC](https://rubytalk.org/t/keyboard-input/82/1 "2002-06-04T20:34:59Z")

</div>

Where can I find information of Ruby’s IO class? And what do you mean by C libraries? was ruby made in C?

–KallDrexx

> **···**
>
> ------ Original Message -----  
> From: Yohanes Santoso [ruby-talk@jenny-gnome.dyndns.org](mailto:ruby-talk@jenny-gnome.dyndns.org)  
> Date: Wed, 5 Jun 2002 04:58:22 +0900  
> To: [ruby-talk@ruby-lang.org](mailto:ruby-talk@ruby-lang.org) (ruby-talk ML)  
> Subject: Re: keyboard input
> 
> > “Matthew Shapiro” [kalldrexx@programmer.net](mailto:kalldrexx@programmer.net) writes:
> > 
> > > keyboard input in a non-blocking way. One thing that I have been  
> > > thinking was using multithreading (which looks amazingly easy in  
> > > ruby) and use the .collect() function, but does this block?
> > 
> > As long as you use the IO functions from the IO class, ruby won’t  
> > block.
> > 
> > > Also will it pick up keys like the up arrow?
> > 
> > That depends on what the C library returns you. If your C library  
> > allows you to pick up the up arrow key using getc, then ditto for  
> > IO#getc.
> > 
> > Now, if my reading of eval.c and _sig_ is correct, then the thread  
> > granularity of ruby is per AST node, and if a node takes more than 500  
> > ticks (of what?, of system’s timer interrupt?), then it is pre-empted  
> > except if Thread#critical is set.
> > 
> > Am I correct?
> > 
> > YS.
> 
> ----KallDrexx
> 
> –
> 
> * * *
> 
> Sign-up for your own FREE Personalized E-mail at [Mail.com](http://Mail.com)  
> [Free email accounts with mail.com | Log in here or register today](http://www.mail.com/?sr=signup)

---

<div class="post-metadata">

**Author:** ![Kent\_Dahl2](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@Kent\_Dahl2](https://rubytalk.org/u/Kent_Dahl2)\
**Post date:** [4 June 2002 21:00 UTC](https://rubytalk.org/t/keyboard-input/82/2 "2002-06-04T21:00:05Z")

</div>

Matthew Shapiro wrote:

> Where can I find information of Ruby’s IO class?

[http://www.rubycentral.com/book/builtins.html](http://www.rubycentral.com/book/builtins.html)

> And what do you mean by C libraries? was ruby made in C?

_peeks in the source_

Yup.

> **···**
>
> –  
> ([Kent Dahl]/)\_ _~_**[[http://www.stud.ntnu.no/~kentda/](http://www.stud.ntnu.no/~kentda/) ]**_/~  
> ))\_student_/(( \__d L b_\_/ NTNU - graduate engineering - 4. year )  
> ( \__\_õ|õ_/**/ ) _)Industrial economics and technological management(  
> \__**/_ö_\_\_\_\_/ (\_**_engineering.discipline_=_Computer::Technology_**)
