Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Fri Sep 14, 2007 11:03 pm   

CTRL-C / CTRL-Z
 
Is it possible to use PuTTy's CTRL-C and CTRL-Z commands using cMUD. (ie. stop the current process, such as compiling)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Sep 15, 2007 12:55 am   
 
It sounds like PuTTy actually is forwarding those keys to the server. To emulate this you will need to set the Macros Override Menu Shortcuts in the package settings and put these into the command line:
Code:
#KEY CTRL-C {#SENDPROMPT %char(3)};#KEY CTRL-Z {#SENDPROMPT %char(26)}

_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Sat Sep 15, 2007 2:25 am   
 
Thanks, that worked well. And have you never answered that question before, or was it a bad question? *smirk*
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Sat Sep 15, 2007 4:46 am   
 
I'm wondering if similar workaround ca be made for PICO's sub-commands. ie. CTRL-W CTRL-X and the others of that type, if ot it's impossible to use pico at all with it. (And I can't think of many reasons to have SSH and not be able to edit files.)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Sep 15, 2007 2:01 pm   
 
Actually I did answer that question before, or at least close enough. It was about 4-5 years ago.

As long as the behavior is done by a serverside interpretation of the control characters then it will work. A simple script to make them all at once is:
Code:
#LOOP 26 {#EXEC {%concat("#KEY CTRL-",%char(63+%i)," {#SENDPROMPT %char(",%i,")}")}}


It might be better to use character mode for this sort of thing rather then making macros for all the control characters. If I remember rigth character mode will pass them directly, and will also give the vt102 controls for sending up, down, left, right, pgup, pgdn, home, end.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Tue Sep 18, 2007 8:22 pm   
 
Hmm, it doesn't appear that the Macros and seting Macros to Over-ride worked, nor did turning on character mode.

These specifically are the keys I'm trying to set up.

Code:
^G Get Help         ^O WriteOut         ^R Read File        ^Y Prev Page        ^K Cut Text         ^C Cur Pos^X Exit             ^J Justify          ^W Where Is         ^V Next Page        ^U UnCut Txt        ^T To Spell         
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Tue Sep 18, 2007 8:27 pm   
 
I figured out the issue, still not certain of the correct syntax to do it all at once, but it had A labeled as 2 b as 3 etc. because of having 1 as a macro that was sent by a blank keypress.
Reply with quote
Fizban1216
Apprentice


Joined: 03 Feb 2007
Posts: 170

PostPosted: Tue Sep 18, 2007 8:53 pm   
 
Still having some issues with Pico working like it should. this specifically causes issues.

Code:
  GNU nano 1.2.4                                       File: testfile                                          Modified 

This is a testfile created in cMUD to test Pico usability.



^G Get Help         ^O WriteOut         ^R Read File        ^Y Prev Page        ^K Cut Text         ^C Cur Pos^X Exit             ^J Justify          ^W Where Is         ^V Next Page        ^U UnCut Txt                           


I hit CTRL-W with the cursor on the prompt (as it doesn't seem to work when the cursor is on the rest of the screen even when in character mode.

Code:
  GNU nano 1.2.4                                       File: testfile                                          Modified 

This is a testfile created in cMUD to test Pico usability.



Search:                                                                                                                 
^G Get Help             ^Y First Line           ^R Replace              M-C Case Sens           M-R Regexp    ^C Cancel               ^V Last Line            ^T Go To Line           M-B Direction           Up History             


I type in the word cMUD.

hit enter all day, it won't search.

The same thing happens when I try to hit CTRL-X to exit. If I tell it to not save by typing n it works and exits. If I type Y it asks save as what filename, and then seems to become unresponsive.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Sep 24, 2007 8:39 pm   
 
To send control characters to the MUD, you *must* use Character Mode and make sure the cursor is in the main MUD window (click on the main MUD window) and not in the command line.

The issue is that these control characters are used for menu shortcuts, and if the command line (or anything other than the MUD window) has the focus, then the Windows menu shortcuts have priority. Only when the MUD window has focus in character mode can CMUD intercept these keys and send them to the MUD.

CMUD will also send CTRL-Key to the MUD if you press ALT-CTRL-Key. This can also be used to get around the Windows menu shortcut issues.

Anyway, if you want CMUD to work as a more normal Telnet/SSH client, using Character Mode is very important.
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Tue Sep 25, 2007 8:06 am   
 
I was thinking about this character mode thing, for TeSSH it's going to need some kind of hybrid character mode I reckon, so you can get the benefits of a typeahead buffer and control characters (otherwise you couldn't really use variables/aliases)... but you're going to run into issues where you want to use the arrow keys to navigate around the screen, but also to replay the last command typed, so it's going to be interesting. Also, you're probably going to want to use cut/copy/paste, but also control+c for stopping a running process, etc so you might need to add additional smarts like "if no text selected in output window and no text selected on command line, send control+c to the server, otherwise copy selected text to the clipboard".

And if said enhancements are made to the smart command line, will they migrate back into CMUD/CMUDPRO or be TeSSH only?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Sep 25, 2007 6:51 pm   
 
Actually, I wasn't planning on changing this in TeSSH. It's all based upon what has keyboard focus. If the MUD window has focus (and character mode is enabled), then control characters get sent to the server. If you are typing on the command line, then control characters trigger menu shortcuts and macros.

The only difference in TeSSH is that Character Mode will probably be enabled by default.

If you want to replay the last command, you will need to click on the command line and then use the arrow keys. If you want to send the arrow keys to the server (like when editing), then you need to click on the output window and then use the arrow keys. Like I said, it's all based upon what has the keyboard focus. That's a very clean way to handle it, so I'm not planning anything else that is more kludged.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Sep 25, 2007 10:26 pm   
 
The only thing I could possibly suggest is a keyboard shortcut to preform switching of modes. I can't think of what would both be easy to press and not used in anyway off the top of my head, but a keyboard based switch would be good.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net