MMkeyboard configuration
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Cool_amigaN
    Posts: 761 from 2011/11/30
    Bought a new cheap chinese rebranded keyboard with multimedia keys. Plus it illuminates, which is cool and gets recognised under MorphOS :)

    To my amazement it also recognizes the following mm keys: Volume Up/Down, Mute and Shoutdown :)

    I managed to edit easily the keyboard on the editor and define the hex values of the unassigned mm keys. Also, I am able to start WB programms such as OWB, YAM, MPlayer Calculator etc.

    However I want to assign some commands which mmkeyboard guide doesn't cover, plus google didn't bring any results. I want to be able perform the following:

    Start/Pause media (on MPlayer and/or Aminet Radio)
    Pevious Media (on MPlayer and/or Aminet Radio)
    Next Media (on MPlayer and/or Aminet Radio)
    Stop media (on MPlayer and/or Aminet Radio)
    Find
    Sleep/WakeUp (is this or a similar feature available on MOS?)
    Start Blanker
    GoBack (on Ambient and/or OWB)
    GoForward (on Ambient and/or OWB)

    Also, in order to start it automaically after boot should I copy both the mmkeyboard server and the mmkeyboard executable on WBStartUp drawer?

    Any ideas?
    Amiga gaming Tribute: Watch, rate, comment :)
  • »31.01.15 - 08:30
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    For automatic launch just copy the icon to wbstartup and make sure the projects tool points to the real installation path.

    If you copy the binary you would also move progdir: to wbstartup and mmkeyboard is unable to find stuff like its guide and other files stored in programm dir. This would require an assign which I wanted to avoid.

    If you install MMKeyboard with Grunch, it takes care of all the setup and you just need to drag the icon named "MMKeyboardServer_WBStartup" to WBStartup.
  • »31.01.15 - 12:38
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Cool_amigaN
    Posts: 761 from 2011/11/30
    @geit

    Thanks man, I assume you are the author cause I downloaded from a website name geit.de :P

    Do you have any idea regarding the commands I want to implement?
    Amiga gaming Tribute: Watch, rate, comment :)
  • »31.01.15 - 13:06
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12155 from 2003/5/22
    From: Germany
    > Sleep/WakeUp (is this or a similar feature available on MOS?)

    https://morph.zone/modules/newbb_plus/viewtopic.php?topic_id=10585&forum=53
  • »31.01.15 - 15:50
    Profile
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2096 from 2003/2/24
    From: po-RNO
    Quote:

    Cool_amigaN wrote:

    Start/Pause media (on MPlayer and/or Aminet Radio)
    Pevious Media (on MPlayer and/or Aminet Radio)
    Next Media (on MPlayer and/or Aminet Radio)
    Stop media (on MPlayer and/or Aminet Radio)


    http://aminet.net/package/mus/play/MultiMeedio


    Quote:

    Find

    Set command type to "Key" and Command to "RCOMMAND f"


    Quote:

    Start Blanker

    You can define this from System Settings -> IControl -> Hotkeys -> Blanker: Turn on


    Quote:

    GoBack (on Ambient and/or OWB)
    GoForward (on Ambient and/or OWB)


    RXCmd OWB.1 BACK
    RXCmd OWB.1 FORWARD

    And Ambient ones probably can be redefined with similar "Key" command like with Find. And probably even both Ambient and OWB in use from the same keys if you filter Task Name in MMKeyboard... I don't have time to test just now though.

    [ Edited by jPV 31.01.2015 - 20:17 ]
  • »31.01.15 - 17:03
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Cool_amigaN
    Posts: 761 from 2011/11/30
    @jPV

    Thanks!

    I managed to implement most of the commands that I wanted and also learned how to filter them through Tasks :)

    However, I am having difficultied understanding how to use your scripts. I 've copied the script to the folder required but in your example screenshot it has an extension of "play". This means that I should create 4 individual scripts (play, forward, previous, stop)? Should I comment anything specific inside the script?
    Amiga gaming Tribute: Watch, rate, comment :)
  • »03.02.15 - 08:00
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2096 from 2003/2/24
    From: po-RNO
    Quote:

    Cool_amigaN wrote:

    However, I am having difficultied understanding how to use your scripts. I 've copied the script to the folder required but in your example screenshot it has an extension of "play". This means that I should create 4 individual scripts (play, forward, previous, stop)?


    The same script must be executed with different argument for different jobs. So, if you're defining MMKeyboard command for your play button, you use "play" argument. And same way if you're defining MMKeyboard command for your next button, you use "next" argument. The actual script stays the same, but yes, you have to create individual entries for each case, and example screenshot was just one of them.

    If you copied MultiMeedio.lua script to S: as suggested, you can do those mentioned functions like:

    MOSSYS:C/LuaX S:MultiMeedio.lua play
    MOSSYS:C/LuaX S:MultiMeedio.lua next
    MOSSYS:C/LuaX S:MultiMeedio.lua prev
    MOSSYS:C/LuaX S:MultiMeedio.lua stop
    etc...

    Possible arguments are Play, Next, Prev, Stop, Pause, Random, Mute, VolUp, VolDown, GlobMute, GlobVolUp, GlobVolDown, FS and Quit.

    You can run those lines from shell too to test how they work.

    For example, if you run "MOSSYS:C/LuaX S:MultiMeedio.lua pause" command and you have MPlayer running, it pauses MPlayer. But if you happen to have AmiNetRadio running, it pauses it. You don't need to tell which player you are using, because the script detects the running player automatically. It works "universally".


    Quote:

    Should I comment anything specific inside the script?


    Script should work as it is without any modifications, but if you want to define the default player to something else than Jukebox, then you can edit the two lines in quite beginning of the script. Default player is started, if no other player is found running.


    [ Edited by jPV 03.02.2015 - 15:11 ]
  • »03.02.15 - 12:08
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Cool_amigaN
    Posts: 761 from 2011/11/30
    Yes! It worked as you explained :)

    Two questions, what the FS argument means and why is syntax of the command MOSSYS:C/LuaX S:MultiMeedio.lua next, shouldn't it be instead MOSSYS:S:MultiMeedio.lua [argument]?
    Amiga gaming Tribute: Watch, rate, comment :)
  • »03.02.15 - 18:43
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12155 from 2003/5/22
    From: Germany
    > why is syntax of the command MOSSYS:C/LuaX S:MultiMeedio.lua next, shouldn't it be
    > instead MOSSYS:S:MultiMeedio.lua [argument]?

    The shell can't execute Lua scripts by itself, so a Lua interpreter is needed, which is LuaX. Besides, more than one colon in a path does not make sense.
  • »03.02.15 - 19:35
    Profile
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2096 from 2003/2/24
    From: po-RNO
    Quote:

    Cool_amigaN wrote:
    Yes! It worked as you explained :)

    Two questions, what the FS argument means and why is syntax of the command MOSSYS:C/LuaX S:MultiMeedio.lua next, shouldn't it be instead MOSSYS:S:MultiMeedio.lua [argument]?


    FS = fullscreen, works with video players (mplayer and xbmc).

    MOSSYS:C/ is the path for LuaX command, which is needed to execute the actual lua script. Similar to ARexx scripts which are executed with RX command.

    S: is the path to the actual script file. S: is a shorter assign to SYS:S/ directory.

    Basically the line "LuaX S:MultiMeedio.lua next" would work too, but I wanted to make sure that correct version of LuaX is used and that's why I told to use full path to LuaX command too. There could be possibility that you'd accidently have older LuaX installed in some other path (SYS:C/ particularly).
  • »03.02.15 - 20:07
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Cool_amigaN
    Posts: 761 from 2011/11/30
    Thank you both for your time and explaination :)

    Everything works great!

    Now, since I configured the keyboard is it possible to map 2 additional buttons of my Logitech G400 mouse on MorphOS?
    Amiga gaming Tribute: Watch, rate, comment :)
  • »04.02.15 - 07:09
    Profile Visit Website