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

Gammon 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

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Samga   (4 posts)  [Biography] bio
Date Sun 12 Dec 2010 02:27 PM (UTC)
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  (899 posts)  [Biography] bio
Date Reply #1 on Sun 12 Dec 2010 03:10 PM (UTC)
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   (4 posts)  [Biography] bio
Date Reply #2 on Sun 12 Dec 2010 03:16 PM (UTC)

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  (525 posts)  [Biography] bio
Date Reply #3 on Sun 12 Dec 2010 06:52 PM (UTC)
Message
btw, newer source code is available on http://github.com/nickgammon/mushclient
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sun 12 Dec 2010 08:53 PM (UTC)
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  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 12 Dec 2010 09:07 PM (UTC)
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

Posted by Ruckinfok   (7 posts)  [Biography] bio
Date Reply #6 on Fri 21 Jun 2013 06:02 PM (UTC)
Message
Is there a way to disable behavior and revert to "normal" ctrl+backspace behavior as mentioned without removing source code?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sat 22 Jun 2013 07:29 AM (UTC)
Message
What is the normal behaviour exactly?

Anyway you can use the Accelerator script function to do something with it, eg.


Accelerator ("Ctrl+Backspace", "foo" )


Or, AcceleratorTo.

- Nick Gammon

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

Posted by Samga   (4 posts)  [Biography] bio
Date Reply #8 on Sat 22 Jun 2013 02:14 PM (UTC)
Message
He's referring to the way I described it. For instance, if you go to reply to this thread, and type a few words in the message box, then hit CTRL+Backspace, it deletes the word directly behind your cursor. He was practically hoping that something had been implemented for the user to toggle between the two implementations. Keep your implementation, but allow the user to switch it to the "normal" CTRL+Backspace functionality.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sun 23 Jun 2013 10:34 AM (UTC)
Message
You can always press Shift+Ctrl+Left-arrow followed by Delete.

That's two keys rather than one, but it lets you delete a whole word.

- 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.


14,554 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]