[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: Roguelike project?
From: Nit Khair <sentinel.2001 () gmx ! com>
Date: 2008-10-31 18:20:36
Message-ID: 1a7c99e7957f2e909612cc85d3d30130 () ruby-forum ! com
[Download RAW message or body]
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/.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic