[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]  Bug reports
. . -> [Subject]  Removing Accelerator doesn't work in ver 5.05
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Removing Accelerator doesn't work in ver 5.05

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


Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Sat 24 Jun 2017 03:59 PM (UTC)
Message
Back about 11 years ago, Ked made a request (bbsubject_id=6634) to remove an Accelerator from the AcceleratorList. This change was added in version 3.75.

Setting an Accelerator to an empty string no longer removes it.


What I'm trying to do: my mud gives exits in the room_short description when wandering around. I'm trying to remap some convenient keys to non-standard exits.

a sample room_short: A Vortex (s,w,e,enter)

my code:

acclerators = {"CTRL+PAGEUP", "CTRL+PAGEDOWN", "SHIFT+PAGEUP", "SHIFT+PAGEDOWN"}
StandardDirs = {n=true, nw = true, ne = true, w=true, e=true, s=true, sw=true, se=true, d=true, u=true}
function onRoomShort( t,l,w,sr )
    for k,v in ipairs(acclerators) do Accelerator(v,"") end
    --tprint(AcceleratorList())
    
    local exitText = l:match("%((.+)%)")
    local rooms = utils.split(exitText, ",")
    local roomIndex = 1
    while rooms[roomIndex] do
        if StandardDirs[rooms[roomIndex]] then 
            table.remove(rooms, roomIndex)
        else
            roomIndex = roomIndex+1
        end
    end
    --tprint(rooms)

    for k,v in ipairs(rooms) do
        Accelerator(acclerators[k], v)
    end

    --tprint(AcceleratorList())

end

shows that Ctrl+PageUp and Ctrl+PageDown are both mapped now. I'm not positive that PageDown was added in a previous buggy version of my code, and not being added each time.


Also, a script entered from the command line: Accelerator("Ctrl+PageDown", "") doesn't get rid of it. I'd like the Accelerators removed so that in the next room, I don't fat finger the wrong key and send bad/deadly commands to the mud.
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Sat 24 Jun 2017 04:52 PM (UTC)

Amended on Sat 24 Jun 2017 04:53 PM (UTC) by Fiendish

Message
It looks to me like the accelerator does get removed. It just doesn't get changed in whatever display list AcceleratorList() is pulling from.

If I do Accelerator("Ctrl+PageDown", ""), the accelerator stops working, but AcceleratorList still shows the old setting.

https://github.com/fiendish/aardwolfclientpackage
[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.


1,144 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]