GNU Readline question (needed for tintin++ modifications)

J

Jason

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
 
J

Jack Klein

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top