Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Another getc method with Curses module.
- # You can get only one character.
- module Curses
- def self.curses_proc
- Curses::init_screen
- ret = yield
- Curses::close_screen
- return ret
- end
- end
- def getc
- require 'curses'
- Curses::curses_proc {
- Curses::getch
- }
- end
- # usage
- if __FILE__ == $0
- puts getc
- end
Add Comment
Please, Sign In to add comment