[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Accelerators

Accelerators

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


Posted by Saerataga   (24 posts)  [Biography] bio
Date Sun 21 May 2023 07:35 PM (UTC)

Amended on Fri 26 May 2023 04:32 AM (UTC) by Nick Gammon

Message
Good Morning,

How do I test if my keyboard is not locked up by windows for using accelerators?

I get no error or success message so no idea if it's my code or if it's my keyboard.


<plugin
   name="Accelerators"
   author="Saerataga"
   id="aaba23f14107f7cccbc97380"
   language="Lua"
   purpose="Allow short hand typing"
   date_written="2023-05-21 16:08:32"
   requires="5.06"
   version="1.0"
   >
   

  Accelerator ("F11", "volume_down")
  Accelerator ("F12", "volume_up")
  Accelerator ("F1", "flee")
  Accelerator ("F4", "recall")


  -- convert string back into Lua table
  assert (loadstring (GetVariable ("accelerators") or "")) ()

  -- if found, process it
  if accelerators then

    for k, v in ipairs (accelerators) do
       local key, action = string.match (v, "^(%S+) = (.*)$")
       if key then
         Accelerator (key, action)
       end -- if matched
    end -- for

  end -- if



</plugin>



[EDIT] Code tags added.
[Go to top] top

Posted by Fiendish   USA  (2,500 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Mon 22 May 2023 05:54 PM (UTC)

Amended on Mon 22 May 2023 05:56 PM (UTC) by Fiendish

Message
There's a setting in global preferences that must be activated to use F1 (and F6).

As for checking whether Windows is stealing your keystrokes, it's hard to universalize across different programs but there are websites and also downloadable tools you can use to see whether they recognize hitting different keystrokes. One I've used is https://www.keyboardtester.com/

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Saerataga   (24 posts)  [Biography] bio
Date Reply #2 on Mon 22 May 2023 10:05 PM (UTC)
Message
The keyboard link tells me that my Function keys have to use Func button in addition to F11 or whatever.

However, Accelerators still not working when I use the func button and F11.

Maybe something is wrong with where I put the accelerator declarations?
[Go to top] top

Posted by Fiendish   USA  (2,500 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Tue 23 May 2023 01:44 AM (UTC)
Message
Quote:
Maybe something is wrong with where I put the accelerator declarations?

They look fine to me. Do you have a volume_down alias defined?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,928 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Fri 26 May 2023 04:38 AM (UTC)
Message
Saerataga said:

The keyboard link tells me that my Function keys have to use Func button in addition to F11 or whatever.

However, Accelerators still not working when I use the func button and F11.


How are you using the Func button? According to the documentation for Accelerator function at http://www.gammon.com.au/scripts/doc.php?function=Accelerator that keystroke is not supported.

For example:

Accelerator ("func+F11", "volume_down")


would not work because Func is not supported.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,928 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Fri 26 May 2023 04:41 AM (UTC)
Message
Saerataga said:


I get no error or success message so no idea if it's my code or if it's my keyboard.



You can put "check" around (some) function calls, like this:


check (Accelerator ("func+F11", "volume_down"))


That raises an error if the function (ie. Accelerator) does not return eOK as documented.

This "check" function call is not supported for all functions, but if the function documentation says it returns eOK on success, then it is supported.

- Nick Gammon

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

Posted by Fiendish   USA  (2,500 posts)  [Biography] bio   Global Moderator
Date Reply #6 on Fri 26 May 2023 05:28 AM (UTC)

Amended on Fri 26 May 2023 02:57 PM (UTC) by Fiendish

Message
The func button keypress is almost always an in-keyboard differentiator between the F value and whatever media function is the button's primary mode. I don't believe that the operating system treats it as its own key like it does with e.g. Shift or Ctrl. Why that is I'm not sure, but it's probably historical. But anyway MUSHclient shouldn't need to worry about it.

I similarly have an "fn" key on my keyboard that I need to press in conjunction with my F-keys because they're otherwise used to control things like screen brightness and volume. MUSHclient doesn't care about it. I press fn+F1 and MUSHclient activates the F1 macro.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Saerataga   (24 posts)  [Biography] bio
Date Reply #7 on Fri 26 May 2023 03:47 PM (UTC)
Message
Thanks guys, I will try adding it and get someone who has a computer that isn't func key to test.
[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.


3,040 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 HostDash]