[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Development
. . -> [Subject]  CTRL+Backspace Code

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

CTRL+Backspace Code

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Samga   (3 posts)  [Biography] bio
Date Sun 12 Dec 2010 02:27 PM (UTC)  quote  ]
Message
I downloaded the source code for 4.02 and am looking for the key combination code that is CTRL+Backspace taking the last word from the command history and putting it into the command window. I just want to remove it, because I, being a programmer at work, use CTRL+Backspace ALL the time, and sometimes, I'll be playing and need to restart a whole sentence, hitting CTRL+Backspace a lot of times, only to remember what CTRL+Backspace does in MUSHClient.

I was going to suggest adding an option for the way CTRL+Backspace works in Global Preferences or something, but I figured I could just remove it myself.

I'll be sifting through the code to find it, but if one of you knows exactly where it is and can tell me, I'd appreciate it.

Thanks.
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Reply #1 on Sun 12 Dec 2010 03:10 PM (UTC)  quote  ]
Message
Have some examples of apps that use Ctrl-Backspace to remove the last word? I never heard of this before (although it does kinda make sense given the effect of Ctrl-Left and Ctrl-Right. Amusing detail though: in MUSHclient, Ctrl-Delete seems to delete everything on the same line after the cursor.

Reason I ask is that Notepad does not have your Ctrl-Backspace functionality, which means it isn't a 'standard' Windows effect. Although it would seem Opera does have this effect as I just tried it out here.

All in all, I'm not opposed at all to making this change to be the default. The old behaviour makes very little practical sense to me personally.
[Go to top] top

Posted by Samga   (3 posts)  [Biography] bio
Date Reply #2 on Sun 12 Dec 2010 03:16 PM (UTC)  quote  ]

Amended on Sun 12 Dec 2010 03:22 PM (UTC) by Samga

Message
Visual Studio for one. Chrome, Firefox, IE even. Microsoft Word, OpenOffice, Digsby, Pidgin, Yahoo Messenger, MSN Messenger, AIM...I could go on.

Basically, every other application I use, aside from the few ones, like notepad and the command line, does CTRL+Backspace like mentioned.

edit: Also, the CTRL+Delete function you speak of is the same as Notepad's.
[Go to top] top

Posted by WillFa   USA  (517 posts)  [Biography] bio
Date Reply #3 on Sun 12 Dec 2010 06:52 PM (UTC)  quote  ]
Message
btw, newer source code is available on http://github.com/nickgammon/mushclient
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sun 12 Dec 2010 08:53 PM (UTC)  quote  ]
Message
Samga said:

I'll be sifting through the code to find it, but if one of you knows exactly where it is and can tell me, I'd appreciate it.



In sendvw.cpp:


void CSendView::OnRepeatLastWord() 
{
// can't, if no previous command
if (m_msgList.IsEmpty ())
  return;

CString strLine = m_msgList.GetTail ();

  strLine.TrimRight ();

int iPos = strLine.ReverseFind (' ');

CString strWord = strLine.Mid (iPos + 1);

GetEditCtrl().ReplaceSel (strWord, TRUE);

}


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 12 Dec 2010 09:07 PM (UTC)  quote  ]
Message
The idea of the original behaviour was this ...

You did some action with something, eg.


punch kobold


And now you want to do something else to it, eg.


kick kobold


So you type:


kick <ctrl+backspace>


That's less keystrokes. It's similar to the Bash shell where you recall the last word with <Esc> .

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,802 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]