Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Using Accelerator

Using Accelerator

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


Posted by Lmclarke   (26 posts)  Bio
Date Mon 16 Sep 2019 03:36 PM (UTC)

Amended on Mon 16 Sep 2019 03:38 PM (UTC) by Lmclarke

Message
Hey there. I'm attempting to map CTRL+UP to cycle through the command history, doing exactly what just tapping UP does in MUSHclient natively. I'm unable to find if it's possible to do that, however - the information I can locate on Accelerator tend to be command strings like "heal" or "eat food."

Is it possible to do this with Accelerator? If so, may I ask how?

<?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 ()

  Accelerator ("ctrl+up", ???)

  -- add more here ...

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

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

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 16 Sep 2019 08:36 PM (UTC)
Message
See:

Template:function=AcceleratorTo AcceleratorTo

The documentation for the AcceleratorTo script function is available online. It is also in the MUSHclient help file.



Template:function=DoCommand DoCommand

The documentation for the DoCommand script function is available online. It is also in the MUSHclient help file.



So your accelerator line should look like this:


AcceleratorTo ("Ctrl+Up", 'DoCommand ("PreviousCommand")', sendto.script)


That maps Ctrl+Up to "do" the command "PreviousCommand" which is the message that maps the menu item Input -> Previous Command to the command handler for that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lmclarke   (26 posts)  Bio
Date Reply #2 on Tue 17 Sep 2019 07:53 AM (UTC)
Message
Ah, thank you! Much appreciated.
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.


10,221 views.

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

Go to topic:           Search the forum


[Go to top] top

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