GNU Readline question (needed for tintin++ modifications)

Discussion in 'C Programming' started by Jason, Oct 18, 2003.

  1. Jason

    Jason Guest

    Hello,

    I have been going through the source code of tintin to see about
    adding key bindings. In working with this I found an issue with how
    keybindings work in GNU readline. The problem is that function keys
    have to be bound as sequences, but on my keyboard F5 has a sequence
    that ends with '~', as does F6 - F12.

    The way I would expect to code in "on the fly" key binding in tintin
    involves having all user defined key bindings to call the same
    function, but the function will have to know which key called it.
    Since all you get in the callback is a count number and a number
    representing the *last* key in the sequence I don't see anyway to tell
    F5 from F12, for example.

    I can certainly have a function for each key but I would like to avoid
    this if possible. Does anyone know a way to do this? I hate to go
    messing around with the readline implimentation to put something in
    for this.

    Thanks in advance,
    Jason
     
    Jason, Oct 18, 2003
    #1
    1. Advertising

  2. Jason

    Jack Klein Guest

    On 17 Oct 2003 20:57:19 -0700, (Jason) wrote in
    comp.lang.c:

    > Hello,
    >
    > I have been going through the source code of tintin to see about
    > adding key bindings. In working with this I found an issue with how
    > keybindings work in GNU readline. The problem is that function keys
    > have to be bound as sequences, but on my keyboard F5 has a sequence
    > that ends with '~', as does F6 - F12.
    >
    > The way I would expect to code in "on the fly" key binding in tintin
    > involves having all user defined key bindings to call the same
    > function, but the function will have to know which key called it.
    > Since all you get in the callback is a count number and a number
    > representing the *last* key in the sequence I don't see anyway to tell
    > F5 from F12, for example.
    >
    > I can certainly have a function for each key but I would like to avoid
    > this if possible. Does anyone know a way to do this? I hate to go
    > messing around with the readline implimentation to put something in
    > for this.
    >
    > Thanks in advance,
    > Jason


    What's your question about the C language? You are severely off-topic
    here.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c /faq
     
    Jack Klein, Oct 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter

    1 day gnu, whole life gnu?

    Peter, Jan 10, 2005, in forum: Java
    Replies:
    3
    Views:
    353
    John C. Bollinger
    Jan 10, 2005
  2. Peter
    Replies:
    17
    Views:
    613
    Chris Smith
    Jan 13, 2005
  3. Markus Elfring
    Replies:
    2
    Views:
    380
    Markus Elfring
    Feb 23, 2005
  4. Replies:
    3
    Views:
    648
    Thomas Lotze
    Aug 2, 2005
  5. Josh Paetzel

    ensuring GNU readline isn't used

    Josh Paetzel, Aug 7, 2007, in forum: Python
    Replies:
    3
    Views:
    319
    Ben Finney
    Aug 8, 2007
Loading...

Share This Page