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 ➜ Enable and disable keypad keys with a macro

Enable and disable keypad keys with a macro

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


Posted by Caelen   (81 posts)  Bio
Date Mon 09 Aug 2010 09:11 AM (UTC)
Message
Is there any built-in keyboard shortcut for enabling and disabling keypad key macros? If not, is there a script command that can be used to do so?
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #1 on Mon 09 Aug 2010 02:39 PM (UTC)
Message
You need to use Accelerator or AcceleratorTo to redefine or unset most macros.
Top

Posted by Caelen   (81 posts)  Bio
Date Reply #2 on Mon 09 Aug 2010 07:50 PM (UTC)
Message
Larkin said:

You need to use Accelerator or AcceleratorTo to redefine or unset most macros.


And those are...?

The specific macros I'm asking about are the keypad keys (the options reached from ctrl+shift+1), since they have a built in checkbox to enable and disable them. I want to be able to toggle that option with an alias or a built-in keyboard shortcut.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 09 Aug 2010 09:51 PM (UTC)
Message

<aliases>
  <alias
   match="disable_keypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>

SetOption ("keypad_enable", 0)
ColourNote ("cyan", "", "Numeric keypad disabled.")

</send>
  </alias>

  <alias
   match="enable_keypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>

SetOption ("keypad_enable", 1)
ColourNote ("cyan", "", "Numeric keypad enabled.")

</send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.



- Nick Gammon

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

Posted by Caelen   (81 posts)  Bio
Date Reply #4 on Tue 10 Aug 2010 12:21 AM (UTC)

Amended on Tue 10 Aug 2010 12:41 AM (UTC) by Nick Gammon

Message
Shiny! Thanks. SetOption ("keypad_enable", #) is exactly what I needed. Question though. What's the difference between "print" and "ColourNote"?

EDIT:

I shortened it up a bit, making one alias to turn it on or off so I could assign it to a macro.

<aliases>
  <alias
   match="togglekeypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>if (GetOption("keypad_enable")) == 1 then
 print "NUMERIC KEYPAD DISABLED"
 SetOption ("keypad_enable", "0")
else
 print "NUMERIC KEYPAD ENABLED"
 SetOption ("keypad_enable", "1")
end</send>
  </alias>
</aliases>


And... the code brackets don't seem to be working?
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 10 Aug 2010 12:44 AM (UTC)
Message
Caelen said:

Shiny! Thanks. SetOption ("keypad_enable", #) is exactly what I needed. Question though. What's the difference between "print" and "ColourNote"?


The print function prints in the world "note" colour as defined in the scripting configuration. ColourNote lets you specify any foreground and background colour you want.

Caelen said:

And... the code brackets don't seem to be working?


It only auto-detects the [code] tag on an initial post. If you edit later and add tags you have to manually check "Forum codes" on the posting.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


21,901 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.