TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

How to change hardcoded behavior for ctrl-c

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
mattikus



Joined: 06 Aug 2008
Posts: 15

PostPosted: Wed Aug 06, 2008 6:03 pm    Post subject: How to change hardcoded behavior for ctrl-c Reply with quote

I recently found tintin after deciding to get back into mudding. I was looking for a nice console client and this seems like its perfect for my needs. However, I'm quite addicted to the console and my hands are trained to hit ctrl-c whenever i mess up a line on the bash terminal, which will reset the input.

I've looked around in the source and I thought I've changed every instance of ctrl-c being hardcoded, but it still persists.

Ideally, i'd like to have ctrl-d be the exit mud command, with ctrl-c being cursor_clear_line.

I tried to set them using #cursor ingame, however #cursor {exit} {anything} will be interpreted as a literal exit.

Anything obvious i'm missing?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3281

PostPosted: Thu Aug 07, 2008 12:29 pm    Post subject: Reply with quote

It's hard to find because tintin uses a signal handler to catch ctrl-c.

terminal.c around row 67 replace

DEL_BIT(io.c_lflag, ECHO|ECHONL|IEXTEN);

with

DEL_BIT(io.c_lflag, ECHO|ECHONL|IEXTEN|ISIG);

#macro {\C-c} {#cursor clear left;cursor clear right}

As of the next release I'll enable ISIG by default and I'll also add a #cursor clear line option.
Back to top
View user's profile Send private message Send e-mail
mattikus



Joined: 06 Aug 2008
Posts: 15

PostPosted: Thu Aug 07, 2008 12:56 pm    Post subject: Reply with quote

Yep, that did the trick just nicely. Ctrl-C is now mapped to #clear line, which apparently is implemented, just not expressed via the config. I have ctrl-d replace the original behavior of ctrl-c which feels much more natural to me.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group