[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]  General
. . -> [Subject]  Keypad Value & Changes?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Keypad Value & Changes?

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


Posted by MattMc   USA  (54 posts)  [Biography] bio
Date Fri 16 Jun 2006 04:42 AM (UTC)
Message
Is there any known way to get the value of a keypad key (like 5, or period, etc) and to change said value all within scripts? I looked a bit and couldn't find anything to do this.
[Go to top] top

Posted by Onoitsu2   USA  (248 posts)  [Biography] bio
Date Reply #1 on Fri 16 Jun 2006 04:50 AM (UTC)
Message
Setting I think can be achieved using the Accelerator functions, but I am not sure, as I have both CTRL and non-CTRL keypad buttons set, so I have 30 buttons I can set, I have all non-CTRL set, and most of the CTRL have a function.

Hope that helps a little lol...

Laterzzz,
Onoitsu2
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #2 on Fri 16 Jun 2006 05:17 AM (UTC)
Message
If you set your keypad with Accelerator() then you can later retrieve the bindings with AcceleratorList(). There's no way, I think, to get what a keypad button was set to if it was set through the dialogue.
[Go to top] top

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 16 Jun 2006 06:43 AM (UTC)
Message
You could use ExportXML to get keypad values. For example to see what is bound to the "/" key:


print (ExportXML (5, "/"))

Output
<keypad>

  <key name="/" >
  <send>inventory</send>
  </key>
</keypad>


Run that through a string.gsub in Lua and you have the answer:


_, _, k = string.find (ExportXML (5, "/"), "<send>(.*)</send>")
print (k)  --> inventory


- Nick Gammon

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

Posted by Nick Gammon   Australia  (21,609 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 16 Jun 2006 06:46 AM (UTC)
Message
Of course you could use ImportXML to change it. :)


/ImportXML [[
<keypad>

  <key name="/" >
  <send>say ohno!</send>
  </key>
</keypad>
]]


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


4,479 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]