From: Nit Khair Date: 2008-11-01T03:20:36+09:00 Subject: Re: Roguelike project? Michael Fellinger wrote: > http://github.com/manveru/ver/tree/master/lib/ver/keymap.rb > but that's a lot more complicated, building a tree structure and > descends down into it until a matching keybinding is found. that > allows emacs-like keybindings like [C-x C-c]. > I am interested in doing key mappings like Vi and emacs. Did look through the code a bit . Could you tell me in brief how you map something like C-x C-c. 1. Do you use some ncurses feature like waiting / delay for another key. 2. Or when C-x is pressed, you check your structure to see if its mapped, and if there's something more like a C-c, then you wait more. 3. something else. Like after the C-x you do another getch() for the next character. Have you faced problems handling Alt-keys ? Do you find that 2 key codes are generated (I am on a mac, btw.). I am fine with F1 etc using TERM=screen. -- Posted via http://www.ruby-forum.com/.