Jump to content
Muxe Inc Forums
Sign in to follow this  
Ian Gotenks

Ndn on Linux with Eterm

Recommended Posts

Hi Ian!

 

Of course it would be possible to reconfigure the terminal emulator to be more compatible to NDN.

I don't know if ETerm is a better choice for such a task.

Maybe you already verified it?

You could share your experience with us...

 

The best way would be to be able to get the keyboard scan codes from X, but I don't know if it is possible at all because NDN is no X application.

 

Stefan / AH

Share this post


Link to post
Share on other sites
Ian Gotenks    0

Hi,

 

> Of course it would be possible to reconfigure the terminal emulator to be more compatible to NDN.

> I don't know if ETerm is a better choice for such a task. Maybe you already verified it?

> You could share your experience with us...

>

> The best way would be to be able to get the keyboard scan codes from X,

> but I don't know if it is possible at all because NDN is no X application.

 

Yeah .. that would be the simplest thing :). But I don't think it is possible ...

 

However with Eterm you could go the oposite way. Eterm allows to define

escape sequences for "individual keysyms together with their modifier's

state". This means that it can be possible to define escape sequence for

ENTER (^M) (predefined of course :)), for ALT+ENTER (for example \e^M),

for CTRL+ENTER (for example \e^Mc), for SHIFT+ENTER (for example \e^Ms),

etc ...

 

What would Ndn gain from this ? Well, the Ndn team could define (I could help

in this I think, if you wanted me to help :)) a "theme", designated for running Ndn.

This theme could define extra escape sequences for all key combinations

reqired by Ndn, which are not accesible by TERMINFO. I don't know if Ndn

uses hardcoded escape sequences or it uses TERMINFO, but I don't think

this makes a big difference. Such a theme could be included in Ndn package

together with a short description how to use Ndn with Eterm + theme_for_Ndn.

 

The user then, could install Eterm, copy Ndn theme to Eterm proper config dir

and then run a command : Eterm -t Ndn -e ndn

 

--

 

Ian

Share this post


Link to post
Share on other sites

Hi!

 

NDN parses the standard keyboard sequences in X, depending on the configuration of X or it's terminals.

So this would be possible.

 

But could the modification/addition of extra sequences also be executed by NDN internally?

And, doesn't X in general allow to define own keyboard sequences?

 

Unfortunately this problem is not easy to fix and requires quite some time to analyze and solve.

Any help is appreciated.

 

Stefan / AH

Share this post


Link to post
Share on other sites
Ian Gotenks    0

Hi Stefan,

 

> NDN parses the standard keyboard sequences in X, depending on the configuration of X or it's terminals.

> So this would be possible.

 

Your statement clearly suggests that Ndn uses hardcoded escape sequences. This can have some

bad side effects. Not all X terminals always send exactly the same escape sequences. For example

rxvt usualy has different escape sequences for HOME and END keys than clasic xterm. So I guess

those keys will not work in Ndn running from rxvt ( I just verified it - they don't work :) ).

 

But this is not a very big problem. In fact it can even help in configuring Ndn for Eterm :).

 

> But could the modification/addition of extra sequences also be executed by NDN internally?

 

I don't think so, but to me it doesn't matter at all. If I knew the escape sequences expected by Ndn

for particular key combinations, I could configure Eterm to send them to make Ndn happy :)

 

> And, doesn't X in general allow to define own keyboard sequences?

 

Yes, but again it doesn't matter. The user can modify keysyms for keycodes, but he shouldn't expect

everything to work ok in case he did it wrongly. It's a user's configuration problem and Ndn can do

nothing to fix it.

 

> Unfortunately this problem is not easy to fix and requires quite some time to analyze and solve.

 

Well, not quite :). It seems to be quite easy to me. Let's make a simple test ... If you make a small patch

to the next Ndn release that, for example, will treat the sequence \e^J3M just like CTRL+ENTER was

pressed, I am pretty much sure that I could configure my Eterm and Ndn to properly handle "Copy to CmdLine",

which would allow me at least to use Ndn on the "day by day" basis :)

 

--

 

Ian

Share this post


Link to post
Share on other sites

Hello Ian!

 

I must repeat myself:

it will NOT be easy to do these modifications.

It will take me quite some time to get it done.

Best thing would be to create an ini file for NDN to read at startup.

 

Is the ^J character an 0x0a in that string?

So the complete sequence would be: $1B 0A 33 4D

Just as a little note: The number (33) after the key (0A) should tell NDN what modifier was used.

But, let's test this combination for the next release.

 

Stefan / AH

Share this post


Link to post
Share on other sites
Ian Gotenks    0

Hi,

 

> I must repeat myself:

> it will NOT be easy to do these modifications.

> It will take me quite some time to get it done.

> Best thing would be to create an ini file for NDN to read at startup.

 

Exactly. The best way would be to have a kind of configuration

file, which could be filled by the user (or filled by ndn during a

"learning keys" session - similary to mc).

 

> Is the ^J character an 0x0a in that string?

 

Yes

 

> So the complete sequence would be: $1B 0A 33 4D

> Just as a little note: The number (33) after the key (0A) should tell

> NDN what modifier was used.

 

It it only hleps you - I see no problem :). SHIFT+ENTER could be coded

as \e^J2M in this case. ALT+ENTER has to be defined as \e^J because

it is generated by xterm by default. SHIFT+CTRL+ENTER could be coded

by \e^J4M, etc ...

 

> But, let's test this combination for the next release.

 

Great !

 

--

 

Ian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×