From: Nit Khair Date: 2008-11-05T03:37:21+09:00 Subject: Re: Roguelike project? Nit Khair wrote: > Nit Khair wrote: >> Michael Fellinger wrote: >> > manver -- a little bit of feedback regarding keyboard.rb. 1. it returns strings. If you use ncurses form drivers these take integers. So one has to convert the value sent to an int to avoid errors. So typically in the start of the press method, I have done: ret = ret[0] if ret.length == 1 ret = 32 if ret == 'space' Even then one has to watch out for others that are not single length tab/return/bs/ etc.... will have to check for others. Some of these are separately handled in the case, such as tab and return so thats okay. Others such as backspace and delete etc which were passed straight to the driver, need to be watched out for. 2. You check for @stopping? inside the while char loop immediately after while. To me this means that after the user has entered the Exit key, he still has to press one more key to actually exit. I've put the break before the end of the loop. Would like you to confirm this. -- Posted via http://www.ruby-forum.com/.