Possible to disable these mush client specific shortcuts?

Posted by LucianDK on Mon 26 Mar 2012 09:44 PM — 7 posts, 27,188 views.

#0
Ctrl+w
Ctrl+t
Ctrl+r
Ctrl+f
Ctrl+g
Ctrl+u
Ctrl+l
Ctrl+n

Problem is that I find myself often hitting the ctrl button with my palm when I write, having a keyboard with a large and wide wrist support, and having those events pop up often is irritating. I dont recall having such problems with shortcuts in earlier versions of mushclient.
Australia Forum Administrator #1
I don't think that has changed recently, but just go into the World configuration -> Macros, and edit each one of those, replacing "take" or whatever by an empty string (ie. delete what is there).
#2
Nick Gammon said:

I don't think that has changed recently, but just go into the World configuration -> Macros, and edit each one of those, replacing "take" or whatever by an empty string (ie. delete what is there).


Managed to stop the macros that would pop up words like whisper and take as I saw there was specific ones for those commands.

Ctrl+r Repeats last send to the world
Ctrl+f Finds text

is however still a problem, no macros present with them in the list, nor is it possible to add new ones to make blank commands.


Edit: Seems as soon I shutdown the client and restarts, the macros reverts to standard, ignoring all the edits made. Been trying to save them after Ive removed the text strings from those having them and set it as the default macros file to load upon startup, no worky.
Amended on Tue 27 Mar 2012 07:53 AM by LucianDK
Australia Forum Administrator #3
Hmm. They should save. But anyway. To cater for the ones not in the list you can make your own accelerators. For example:


AcceleratorTo ("Ctrl+R" , "", sendto.script )


This says if you type Ctrl+R send an empty string to the script engine (ie. do nothing).

You would need one such for each of the ctrl keys you want to suppress.

These won't save either, but see:

Template:faq=39
Please read the MUSHclient FAQ - point 39.


That shows a small plugin you can make which will remember the accelerator keys. Just amend the middle to be like what I showed above, save that as a plugin and install it.
#4
Created the accelerators.xml file

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Accelerators"
author="Nick Gammon"
id="bcd4c85623b51c11ec643123"
language="Lua"
purpose="Add custom keystrokes"
date_written="2007-04-17 16:16:25"
requires="3.80"
version="1.0"
>
</plugin>
<script>
<![CDATA[
function OnPluginInstall ()

AcceleratorTo ("Ctrl+w" , "", sendto.script )
AcceleratorTo ("Ctrl+t" , "", sendto.script )
AcceleratorTo ("Ctrl+r" , "", sendto.script )
AcceleratorTo ("Ctrl+f" , "", sendto.script )
AcceleratorTo ("Ctrl+g" , "", sendto.script )
AcceleratorTo ("Ctrl+u" , "", sendto.script )
AcceleratorTo ("Ctrl+l" , "", sendto.script )
AcceleratorTo ("Ctrl+n" , "", sendto.script )

-- add more here ...

-- list them
for _, v in ipairs (AcceleratorList ()) do Note (v) end

end -- function OnPluginInstall
]]>
</script>
</muclient>


But upon installing the plugin, this message appears:

Error number: 0
Event: Run-time error
Description: [string "Plugin"]:15: bad argument #1 to 'ipairs' (table expected, got nil)

stack traceback:

[C]: in function 'ipairs'

[string "Plugin"]:15: in function <[string "Plugin"]:1>
Called by: Function/Sub: OnPluginInstall called by Plugin Accelerators

Reason: Executing plugin Accelerators sub OnPluginInstall
Australia Forum Administrator #5
Looks like you have to have a space between the quotes. This worked OK for me:

Template:saveplugin=Accelerators
To save and install the Accelerators plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Accelerators.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Accelerators.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
  name="Accelerators"
  author="Nick Gammon"
  id="bcd4c85623b51c11ec643123"
  language="Lua"
  purpose="Add custom keystrokes"
  date_written="2007-04-17 16:16:25"
  requires="3.80"
  version="1.0"
>
</plugin>

<script>

<![CDATA[

function OnPluginInstall ()

  AcceleratorTo ("Ctrl+W" , " ", sendto.script )
  AcceleratorTo ("Ctrl+T" , " ", sendto.script )
  AcceleratorTo ("Ctrl+R" , " ", sendto.script )
  AcceleratorTo ("Ctrl+F" , " ", sendto.script )
  AcceleratorTo ("Ctrl+G" , " ", sendto.script )
  AcceleratorTo ("Ctrl+U" , " ", sendto.script )
  AcceleratorTo ("Ctrl+L" , " ", sendto.script )
  AcceleratorTo ("Ctrl+N" , " ", sendto.script )
  
  -- add more here ...

end -- function OnPluginInstall

]]>
</script>
</muclient>

#6
That did the trick and they are saved on restart :)

no more bothersome shortcuts. Thank you.