Gammon Forum
Entire forum
MUSHclient
General
keypad woes
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Cron0
United Kingdom (11 posts) bio
|
Date
| Thu 09 Oct 2003 11:49 PM (UTC) |
Message
| I have a system of aliases which use letters and numbers in different combinations, eg. 1, 2, 3, 23, 22, n2, g1, k1, x4, etc. I would like to use the numeric keypad to input the numbers part of these aliases, but would still like to retain the ctrl-keypad macros for movement. I can't think of any way to do this, is it possible at all?
It would work with keypad keys enabled, and set to the actual numbers, if there was an 'insert' option like macros have, so I could use the keypad to add the correct number to the letter in the command window.
If I disable keypad keys, I can use the numbers in my aliases ok, but I lose the ctrl macros. I had thought of world.DoCommand to toggle the keypad on or off, but there doesn't seem to be an option to 'enable keypad keys'. I know you can bring up the keypad dialogue, but thats not really good enough for what I want.
Anyone have any thoughts on this please? | top |
|
Posted by
| Flannel
USA (1,230 posts) bio
|
Date
| Reply #1 on Fri 10 Oct 2003 12:11 AM (UTC) |
Message
| world.setoption "keypad_enable", 1
and
world.setoption "keypad_enable", 0
To Enable/disable keypad things.
You could even couple this with getoption to toggle it...
But, a toggle might not be a good idea, since if you toggle it one too many times, youll be using numbers when you really want Ctrl-Keys, etc. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | top |
|
Posted by
| Poromenos
Greece (1,037 posts) bio
|
Date
| Reply #2 on Fri 10 Oct 2003 11:54 AM (UTC) |
Message
| You can have an alias like "set_number_in_command *" or whatever, and write in the keypad numbers:
set_number_in_command 1
set_number_in_command 2
set_number_in_command 3
etc.
And the alias would be a small script that would append the number to the command box... but if you had the text caret positioned between 2 letters, it would still append it instead of positioning it in the right place... Well, that's good enough, i assume... |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | top |
|
Posted by
| Cron0
United Kingdom (11 posts) bio
|
Date
| Reply #3 on Tue 14 Oct 2003 04:09 PM (UTC) |
Message
| Thanks guys, I have the keypad keys set to 'keypad 1' 'keypad 2' etc., with an alias 'keypad *' calling this small script:
sub number (thename, theoutput, thewildcards)
world.execute world.GetCommand() & thewildcards(1)
end sub
This works just great, but i would also like to clear the command window, so i don't have to delete the letter i have just entered. I have tried setcommand "" and deletecommandhistory, but neither seems to work.
For example, I type the letter 'a' in the command window, then press 1 on the keypad and 'a1' is sent to the scripting engine. Now I have to delete 'a' from the command window manually, but is there a way to accomplish this in the script? | top |
|
Posted by
| Magnum
Canada (580 posts) bio
|
Date
| Reply #4 on Wed 15 Oct 2003 02:14 AM (UTC) |
Message
| PushCommand
http://www.gammon.com.au/scripts/function.php?name=PushCommand
This actually pushes the command into the history stack, and then clears the command box. You can recall the text you had on the command line by standard means (Eg: Pressing up arrow). |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | 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.
16,971 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.