[piCorePlayer] Customization of RF remote control keys?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CJS
    Senior Member
    • Dec 2018
    • 2168

    [piCorePlayer] Customization of RF remote control keys?

    Dear Squeezebox community,

    I have a few question about the possibility to customize RF remote control keys in piCorePlayer. But let me start with describing my pCP setup.

    I built a Squeezebox player using a Raspberry Pi ZeroW board in combination with piCorePlayer. I can control pCP with a smartphone control app (I am using Squeeze Ctrl on an Android phone), but also wanted to be able to control pCP using an RF remote control. To accomplish this I installed the Jivelite extension in pCP, and bought an RF remote control to control Jivelite. The Jivelite screen is displayed on my TV via the HDMI output of the RPi ZeroW.

    The RF remote control that I bought is a "model T3" device that is described here: https://forum.kodi.tv/showthread.php?tid=278842 . This remote is sold on Aliexpress for circa 10 US dollar, for example here: https://www.aliexpress.com/item/4000671247122.html . It is actually a multi-function remote control that can be switched between RF mode (in this mode it can also work as a mouse) and IR mode. I am using the RF mode for remote control of piCorePlayer via Jivelite, and the IR mode for remote control of my Stereo set. The remote comes with an RF receiver in the form of an USB dongle, that is connected to the USB port of my RPi ZeroW using an USB to micro-USB adapter cable.

    After connecting the RF receiver to the USB port of the RPi ZeroW, RF remote control was working immediately (i.e. without installing LIRC or IR tools for Jivelite), and most keys at the front side of the remote have the function that I would expect. So RF remote control is actually working quite well, but if possible I would like to change the function of a few keys. For example, with the existing key mapping, somehow I unintentially changed internet radio station presets a few times. I think I can avoid this by removing c.q. changing the function of the 4 coloured buttons at the front side of the remote. Also I would like to change the behavior of the pause/play button, i.e. give it the same function as the space bar at the bottom side of the remote.

    Finally here are my questions:
    1) Where in piCorePlayer is the mapping of RF remote control keys defined? Is it in piCore Linux or in Jivelite?
    2) Does anybody know if it is possible to customize the key mapping? If so, how?
    3) Is there a linux tool to detect the key code of RF remote control keys? I suppose that I first need to know the key code of a specific key before I can map the key on another action.

    Thanks in advance for your help.


    PS: A picture of the RF+IR remote that I use is shown below. The USB dongle is the (2.4GHz) RF receiver. See https://forum.kodi.tv/showthread.php?tid=278842 for more info.
    Click image for larger version

Name:	T3-RF-IR-remote-control.jpg
Views:	1
Size:	79.2 KB
ID:	1578391
    Last edited by CJS; 2020-08-06, 10:27. Reason: Added picture
    | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |
  • ralphy
    Senior Member
    • Jan 2006
    • 3229

    #2
    This post documents how to find the keycode generated for the keys you want to change and this one outlines how to modify the jivelite key mapping in picoreplayer.
    Ralphy

    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
    Squeezebox client builds donations always appreciated.

    Comment

    • CJS
      Senior Member
      • Dec 2018
      • 2168

      #3
      Originally posted by ralphy
      This post documents how to find the keycode generated for the keys you want to change and this one outlines how to modify the jivelite key mapping in picoreplayer.
      Thanks raplhy for providing links to essential informaton on this subject!
      I will give it a try and report back in this thread. This may take a few days though due to other activities.

      PS: Response on dmesg | grep input is as follows:
      Code:
      dmesg | grep input
      [    2.367267] input: FREEWAY TECHNOLOGY RFIC-MOUSE Keyboard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:25A7:2402.0001/input/input0
      [    2.433422] input: FREEWAY TECHNOLOGY RFIC-MOUSE Consumer Control as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:25A7:2402.0001/input/input1
      [    2.433625] input: FREEWAY TECHNOLOGY RFIC-MOUSE System Control as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:25A7:2402.0001/input/input2
      [    2.433842] input: FREEWAY TECHNOLOGY RFIC-MOUSE as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:25A7:2402.0001/input/input3
      [    2.434489] hid-generic 0003:25A7:2402.0001: input,hiddev96,hidraw0: USB HID v1.01 Keyboard [FREEWAY TECHNOLOGY RFIC-MOUSE] on usb-20980000.usb-1/input0
      [    2.439211] input: FREEWAY TECHNOLOGY RFIC-MOUSE as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.1/0003:25A7:2402.0002/input/input5
      [    2.441095] hid-generic 0003:25A7:2402.0002: input,hidraw1: USB HID v1.01 Mouse [FREEWAY TECHNOLOGY RFIC-MOUSE] on usb-20980000.usb-1/input1
      When running sudo evtest I get following response:
      Code:
      sudo evtest
      No device specified, trying to scan all of /dev/input/event*
      Available devices:
      /dev/input/event0:      FREEWAY TECHNOLOGY RFIC-MOUSE Keyboard
      /dev/input/event1:      FREEWAY TECHNOLOGY RFIC-MOUSE Consumer Control
      /dev/input/event2:      FREEWAY TECHNOLOGY RFIC-MOUSE System Control
      /dev/input/event3:      FREEWAY TECHNOLOGY RFIC-MOUSE
      /dev/input/event4:      FREEWAY TECHNOLOGY RFIC-MOUSE
      Select the device event number [0-4]:
      Further I noticed that most buttons on the front of the remote generate a response on event0, and the remaining ones on event1.
      So far so good. Thanks again!
      Last edited by CJS; 2020-08-06, 22:39.
      | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

      Comment

      • CJS
        Senior Member
        • Dec 2018
        • 2168

        #4
        Hi Ralphy,

        Originally posted by ralphy
        This post documents how to find the keycode generated for the keys you want to change ...
        With the help of your instructions and the evtest program I could detect the keycodes of all buttons that are located at the front of the T3 RF remote control. The picture below shows the keycode for each button, as well as the input / event (event0, event1, event2) on which the keycode is received.

        Click image for larger version

Name:	T3_RF_RC_keycodes_front_buttons.png
Views:	1
Size:	163.5 KB
ID:	1569568

        Originally posted by ralphy
        ... and this one outlines how to modify the jivelite key mapping in picoreplayer.
        I am struggling with this step. After extracting the default InputToActionMap.lua file from /tce/optional/pcp-jivelite.tcz, I modified the content of this file. My plan was to change c.q. create following key mappings (keycode => wanted action):
        Code:
        [KEY_PLAYPAUSE] = "pause",
        [KEY_F3] = "go_search",
        [KEY_F4] = "disabled",
        [KEY_F5] = "disabled",
        [KEY_F6] = "disabled",
        [KEY_F7] = "disabled",
        As it happens to be, none of these 6 keycodes exist in the default InputToActionMap.lua file, even if jivelite does respond on pressing the F3 to F7 function keys by playing presets 3 to 7. It seems that (for example) key code [KEY_F3] is mapped on action "play_preset_3", even if code [KEY_F3] is not defined in InputToActionMap.lua. Since the 6 keycodes did not exist I added the code shown above to the end of section "keyActionMappings.press", and copied the modified InputToActionMap.lua to /home/tc/.jivelite/userpath/jive/InputToActionMap.lua, as instructed in the linked post (btw I first created folder jive since this folder did not exist under /home/tc/.jivelite/userpath) :

        Originally posted by ralphy
        Just copy the modified InputToActionMap.lua to /home/tc/.jivelite/userpath/jive/InputToActionMap.lua and quit jivelite. When it automatically restarts jivelite will use your version instead of the one in the tcz package.
        => Can you (Ralphy or somebody else) tell me how to "quit jivelite"? Since I did not know how to do this, I rebooted pCP expecting that jivelite would pick up the modified InputToActionMap.lua. But the response of jivelite on the 6 added keycodes had not changed, and when I used WinSCP to check the contents of folder /home/tc/.jivelite/userpath it appeared that folder jive with the modified InputToActionMap.lua file had disappeared. It seems like folder /home/tc/.jivelite is recreated after reboot? In a second attempt, I again copied the modified InputToActionMap.lua to folder /home/tc/.jivelite/userpath/jive, but before rebooting pCP I stored settings to SD card via the Jivelite GUI (jivelite HOME => Settings => piCorePlayer=>Save Settings to SD Card). In this case after rebooting pCP, at the end of the boot process jivelite was started, but the jivelite GUI did not appear on the screen. Maybe this is because jivelite, when reading the modified InputToActionMap.lua, does not recognize the 6 added keycodes?

        I checked that in this case file /home/tc/.jivelite/userpath/jive/InputToActionMap.lua was there. After deleting folder /home/tc/.jivelite/userpath/jive with modified InputToActionMap.lua (sudo rm -r /home/tc/.jivelite/userpath/jive) the jivelite GUI appeared again on the screen.

        Can anybody tell me what I should do to create the 6 custom keymappings mentioned above?
        Last edited by CJS; 2020-08-08, 22:42. Reason: Fixed few typos and added some extra details
        | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

        Comment

        • ralphy
          Senior Member
          • Jan 2006
          • 3229

          #5
          There is a Quit menu item at the bottom of the main menu in jivelite. Alternatively, you can press the small letter o to quit immediately. Picoreplayer will restart jivelite automatically.

          Unfortunately, you can't add new key codes in InputToActionMap.lua as all keys must be registered in the jive framework C source first, which then requires recompiling jivelite and as you discovered if jivelite doesn't recognize the key code it won't start.

          The Fn (function) keys are reassigned in the framework to KEY_PRESET_n so you should be able to map

          Code:
          [KEY_PRESET_3] = "go_search",
          If the KEY_PLAYPAUSE doesn't respond as KEY_PLAY or KEY_PAUSE you won't likely be able to map it without modifying the SDL library and recompiling it and jivelite.
          Last edited by ralphy; 2020-08-09, 15:18.
          Ralphy

          1-Touch, 5-Classics, 3-Booms, 2-UE Radio
          Squeezebox client builds donations always appreciated.

          Comment

          • CJS
            Senior Member
            • Dec 2018
            • 2168

            #6
            Originally posted by ralphy
            There is a Quit menu item at the bottom of the main menu in jivelite. Alternatively, you can press the small letter o to quit immediately. Picoreplayer will restart jivelite automatically.
            Thanks Ralphy. I had earlier hidden Quit from the HOME menu, that is why I did not see it... Pressing letter o indeed works.

            Unfortunately, you can't add new key codes in InputToActionMap.lua as all keys must be registered in the jive framework C source first, which then requires recompiling jivelite and as you discovered if jivelite doesn't recognize the key code it won't start.

            The Fn (function) keys are reassigned in the framework to KEY_PRESET_n so you should be able to map

            Code:
            [KEY_PRESET_3] = "go_search",
            Following your suggestion I have modified the behavior of function keys F3 to F7 by means of following changes to sections keyActionMappings.press as well as keyActionMappings.hold in InputToActionMap.lua:
            Code:
            [KEY_PRESET_3] = "go_search",
            [KEY_PRESET_4] = "disabled",
            [KEY_PRESET_5] = "disabled",
            [KEY_PRESET_6] = "disabled",
            [KEY_PRESET_7] = "disabled",
            FYI, the reason for disabling the coloured function keys F4 to F7 is that these keys are programmed to function as "Source Select" keys for my Stereo set when the RC operates in IR mode. For selecting a different input source for my Stereo, I need to long-press one of these function keys in IR mode. It happened a few times that I long-pressed one of these keys for selecting a different input source for my Stereo, assuming that the RC was operating in IR mode, while in reality the RC was operating in RF mode. By disabling the function keys in RF mode it is avoided that presets are accidentally changed.

            Apart from changing the behavior of the function keys I also modified the mapping of the special characters for setting presets 1 to 9. I did this because the order of special characters on this T3 Remote Control is different from the order that is used on standard PC/Laptop keyboards, refer to picture below:

            Click image for larger version

Name:	T3_Air-Mouse_keyboard.jpg
Views:	1
Size:	140.3 KB
ID:	1569588

            I changed the mapping by selecting the special character that is physically located directly below the corresponding numerical key.
            Following changes were made to section charActionMappings.press in InputToActionMap.lua:

            Code:
            --	[")"]  = "set_preset_0",
            	["!"]  = "set_preset_1",
            	["^"]  = "set_preset_2",
            	["#"]  = "set_preset_3",
            	["$"]  = "set_preset_4",
            	["%"]  = "set_preset_5",
            	["&"]  = "set_preset_6",
            	["*"]  = "set_preset_7",
            	["("]  = "set_preset_8",
            	[")"]  = "set_preset_9",
            The line for set_preset_0 is commented out, since character ")" is used for set_preset_9. With this mapping it is easy to set presets 1 to 9 by means of the Remote Control. Only limitation is that preset 0 (corresponding with preset 10 in LMS) cannot be set with the RC. If needed it is still possible to set preset 10 via the web interface of LMS, or by selecting piCorePlayer as player in SqueezePlay on a Windows PC.

            If the KEY_PLAYPAUSE doesn't respond as KEY_PLAY or KEY_PAUSE you won't likely be able to map it without modifying the SDL library and recompiling it and jivelite.
            Not being a programmer, at this moment in time I consider modification of source code and recompilation of Jivelite a step to far. It is a pity that I can't pause/play audio with the PLAYPAUSE key at the front side of the RC, but I can still do this by using the SPACE bar at the back side. This is a limitation that I can live with.

            Thanks again Ralphy for your help! For users that use a similar RF/USB remote control to control piCorePlayer and that also want to customize the function of remote control buttons I have provided installation instructions in the next post in this thread.
            Last edited by CJS; 2020-08-11, 16:10.
            | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

            Comment

            • CJS
              Senior Member
              • Dec 2018
              • 2168

              #7
              For people that use a simular RF/USB remote control to control piCorePlayer via Jivelite I have attached a zip file with following content:
              • Original InputToActionMap.lua file that comes with Jivelite
              • Modified InputToActionMap.lua that changes the function of a few buttons on the Remote Control, as discussed in my previous post
              • Excel sheet that shows the keycodes that are generated by the model T3 remote control
              • README.txt file that explains how to install the modified InputToActionMap.lua in piCorePlayer. This text file also contains some extra information about how to use evtest for detection of keycodes that are generated by a RF/USB remote control.

              Attachment => T3_Jive_keymap.zip


              HOW TO INSTALL A CUSTOM InputToActionMap.lua FILE FOR JIVELITE IN PICOREPLAYER
              Instructions below make use of Win32DiskImager, Putty and WinSCP on a Windows PC. Also it is assumed that Jivelite is installed in piCorePlayer, and that the Joggler skin is used.
              Lines that start with $ are commands that are entered on the Putty commandline.

              1) First make a backup image of the piCorePlayer SD card using Win32DiskImager. To minimize the file size of the image select "Read Only Allocated Partitions" in Win32DiskImager.

              2) Boot piCorePlayer and SSH into piCorePlayer using Putty:
              login as: tc
              password: piCore

              3) Create folder temp in /home/tc
              $ mkdir temp

              4) Create folder jive in /home/tc/.jivelite/userpath
              $ cd /home/tc/.jivelite/userpath
              $ sudo mkdir jive

              5) Copy customized InputToActionMap.lua from Windows PC to piCoreplayer using WinSCP. Copy InputToActionMap.lua to folder /home/tc/temp that was created in step 3.

              6) Copy InputToActionMap.lua from folder temp to folder /home/tc/.jivelite/userpath/jive
              $ cd /home/tc/temp
              $ sudo cp InputToActionMap.lua ../.jivelite/userpath/jive

              7) Quit Jivelite, by pressing key o at the back side of the T3 Remote Control.
              Jivelite should restart automatically and pick up the custom InputToActionMap.lua file

              8) Check that the modified remote control keys work as expected.
              If the Jivelite GUI does not start, SSH into pCP and delete the custom InputToActionMap.lua from folder /home/tc/.jivelite/userpath/jive as follows
              $ sudo rm /home/tc/.jivelite/userpath/jive/InputToActionMap.lua

              9) This is an optional step to reduce data that is saved to SD card in the next step.
              If the modified keys work as expected, SSH into piCorePlayer again and remove InputToActionMap.lua from folder temp:
              $ cd temp
              $ rm InputToActionMap.lua

              10) Save the customized key map /home/tc/.jivelite/userpath/jive/InputToActionMap.lua to SD card using your Remote Control:
              Jivelite HOME => Settings => piCorePlayer => Save Settings to SD Card
              This saves piCorePlayer settings to SD card, including all files under /home/tc. These settings are restored when booting PiCorePlayer

              11) Reboot piCorePlayer by selecting "Reboot piCorePlayer" in the same piCorePlayer menu

              12) Double check that the modified keys work as expected.

              Regards,
              CJS
              | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

              Comment

              • CJS
                Senior Member
                • Dec 2018
                • 2168

                #8
                Hi Ralphy,

                I was thinking, when you make the next update of Jivelite for piCorePlayer (maybe for the next version of piCorePlayer?), can you consider to add "KEY_PLAYPAUSE" to the jive framework and to InputToActionMap.lua? This would help people that use an RF remote control like myself. Let me know if it would help when I create an issue at https://github.com/ralph-irving/tcz-jivelite/issues.

                Also, for setting presets 0 to 9, it would be convenient if this could be done by long-pressing numerical keys 0 to 9 at the front side of the remote control. This is how presets 1 to 6 can be set on the front panel of the Squeezebox Boom. Is this something that could be implemented in a next release of tcz-jivelite without breaking existing functionality?

                Kind regards, CJS.
                | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

                Comment

                • Paul Webster
                  Senior Member
                  • Apr 2005
                  • 9634

                  #9
                  Looks like a useful remote at a reasonable price.
                  I'm interested to see how it works after you have used it for a while - i.e. build quality
                  Paul Webster
                  Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
                  and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

                  Comment

                  • ralphy
                    Senior Member
                    • Jan 2006
                    • 3229

                    #10
                    Originally posted by CJS
                    I was thinking, when you make the next update of Jivelite for piCorePlayer (maybe for the next version of piCorePlayer?), can you consider to add "KEY_PLAYPAUSE" to the jive framework and to InputToActionMap.lua? This would help people that use an RF remote control like myself. Let me know if it would help when I create an issue at https://github.com/ralph-irving/tcz-jivelite/issues.
                    Maybe I could remap KEY_PLAYPAUSE to KEY_PAUSE for the next picoreplayer release, but I don't have a remote that generates a KEY_PLAYPAUSE event.
                    What are the scancodes reported by evtest for it?

                    Originally posted by CJS
                    Also, for setting presets 0 to 9, it would be convenient if this could be done by long-pressing numerical keys 0 to 9 at the front side of the remote control. This is how presets 1 to 6 can be set on the front panel of the Squeezebox Boom. Is this something that could be implemented in a next release of tcz-jivelite without breaking existing functionality?
                    Currently a long press of the Fn (function) key saves to the presets and pressing an Fn key selects it.
                    Ralphy

                    1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                    Squeezebox client builds donations always appreciated.

                    Comment

                    • Howard Passman
                      Senior Member
                      • Apr 2008
                      • 1605

                      #11
                      I, for one, would like to thank you for this primer.

                      Thank you very much.

                      Howard


                      Originally posted by CJS
                      For people that use a simular RF/USB remote control to control piCorePlayer via Jivelite I have attached a zip file with following content:
                      • Original InputToActionMap.lua file that comes with Jivelite
                      • Modified InputToActionMap.lua that changes the function of a few buttons on the Remote Control, as discussed in my previous post
                      • Excel sheet that shows the keycodes that are generated by the model T3 remote control
                      • README.txt file that explains how to install the modified InputToActionMap.lua in piCorePlayer. This text file also contains some extra information about how to use evtest for detection of keycodes that are generated by a RF/USB remote control.

                      Attachment => [ATTACH]31253[/ATTACH]


                      HOW TO INSTALL A CUSTOM InputToActionMap.lua FILE FOR JIVELITE IN PICOREPLAYER
                      Instructions below make use of Win32DiskImager, Putty and WinSCP on a Windows PC. Also it is assumed that Jivelite is installed in piCorePlayer, and that the Joggler skin is used.
                      Lines that start with $ are commands that are entered on the Putty commandline.

                      1) First make a backup image of the piCorePlayer SD card using Win32DiskImager. To minimize the file size of the image select "Read Only Allocated Partitions" in Win32DiskImager.

                      2) Boot piCorePlayer and SSH into piCorePlayer using Putty:
                      login as: tc
                      password: piCore

                      3) Create folder temp in /home/tc
                      $ mkdir temp

                      4) Create folder jive in /home/tc/.jivelite/userpath
                      $ cd /home/tc/.jivelite/userpath
                      $ sudo mkdir jive

                      5) Copy customized InputToActionMap.lua from Windows PC to piCoreplayer using WinSCP. Copy InputToActionMap.lua to folder /home/tc/temp that was created in step 3.

                      6) Copy InputToActionMap.lua from folder temp to folder /home/tc/.jivelite/userpath/jive
                      $ cd /home/tc/temp
                      $ sudo cp InputToActionMap.lua ../.jivelite/userpath/jive

                      7) Quit Jivelite, by pressing key o at the back side of the T3 Remote Control.
                      Jivelite should restart automatically and pick up the custom InputToActionMap.lua file

                      8) Check that the modified remote control keys work as expected.
                      If the Jivelite GUI does not start, SSH into pCP and delete the custom InputToActionMap.lua from folder /home/tc/.jivelite/userpath/jive as follows
                      $ sudo rm /home/tc/.jivelite/userpath/jive/InputToActionMap.lua

                      9) This is an optional step to reduce data that is saved to SD card in the next step.
                      If the modified keys work as expected, SSH into piCorePlayer again and remove InputToActionMap.lua from folder temp:
                      $ cd temp
                      $ rm InputToActionMap.lua

                      10) Save the customized key map /home/tc/.jivelite/userpath/jive/InputToActionMap.lua to SD card using your Remote Control:
                      Jivelite HOME => Settings => piCorePlayer => Save Settings to SD Card
                      This saves piCorePlayer settings to SD card, including all files under /home/tc. These settings are restored when booting PiCorePlayer

                      11) Reboot piCorePlayer by selecting "Reboot piCorePlayer" in the same piCorePlayer menu

                      12) Double check that the modified keys work as expected.

                      Regards,
                      CJS

                      Comment

                      • CJS
                        Senior Member
                        • Dec 2018
                        • 2168

                        #12
                        Originally posted by ralphy
                        Maybe I could remap KEY_PLAYPAUSE to KEY_PAUSE for the next picoreplayer release, but I don't have a remote that generates a KEY_PLAYPAUSE event.
                        What are the scancodes reported by evtest for it?
                        It would be very nice if you could consider this for the next pCP release.

                        Running evtest, selecting event1 and then pressing button KEY_PLAYPAUSE gives the following output.
                        First only the output after pressing button KEY_PLAYPAUSE:
                        Code:
                        Testing ... (interrupt to exit)
                        Event: time 1597347865.699200, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
                        Event: time 1597347865.699200, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
                        Event: time 1597347865.699200, -------------- SYN_REPORT ------------
                        Event: time 1597347865.851171, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
                        Event: time 1597347865.851171, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
                        Event: time 1597347865.851171, -------------- SYN_REPORT ------------
                        For completeness also the full output of evtest:
                        Code:
                        sudo evtest
                        No device specified, trying to scan all of /dev/input/event*
                        Available devices:
                        /dev/input/event0:      FREEWAY TECHNOLOGY RFIC-MOUSE Keyboard
                        /dev/input/event1:      FREEWAY TECHNOLOGY RFIC-MOUSE Consumer Control
                        /dev/input/event2:      FREEWAY TECHNOLOGY RFIC-MOUSE System Control
                        /dev/input/event3:      FREEWAY TECHNOLOGY RFIC-MOUSE
                        /dev/input/event4:      FREEWAY TECHNOLOGY RFIC-MOUSE
                        Select the device event number [0-4]: 1
                        Input driver version is 1.0.1
                        Input device ID: bus 0x3 vendor 0x25a7 product 0x2402 version 0x101
                        Input device name: "FREEWAY TECHNOLOGY RFIC-MOUSE Consumer Control"
                        Supported events:
                          Event type 0 (EV_SYN)
                          Event type 1 (EV_KEY)
                            Event code 1 (KEY_ESC)
                            Event code 28 (KEY_ENTER)
                            Event code 74 (KEY_KPMINUS)
                            Event code 78 (KEY_KPPLUS)
                            Event code 103 (KEY_UP)
                            Event code 105 (KEY_LEFT)
                            Event code 106 (KEY_RIGHT)
                            Event code 108 (KEY_DOWN)
                            Event code 110 (KEY_INSERT)
                            Event code 111 (KEY_DELETE)
                            Event code 113 (KEY_MUTE)
                            Event code 114 (KEY_VOLUMEDOWN)
                            Event code 115 (KEY_VOLUMEUP)
                            Event code 116 (KEY_POWER)
                            Event code 119 (KEY_PAUSE)
                            Event code 120 (KEY_SCALE)
                            Event code 128 (KEY_STOP)
                            Event code 130 (KEY_PROPS)
                            Event code 131 (KEY_UNDO)
                            Event code 133 (KEY_COPY)
                            Event code 134 (KEY_OPEN)
                            Event code 135 (KEY_PASTE)
                            Event code 136 (KEY_FIND)
                            Event code 137 (KEY_CUT)
                            Event code 138 (KEY_HELP)
                            Event code 139 (KEY_MENU)
                            Event code 140 (KEY_CALC)
                            Event code 142 (KEY_SLEEP)
                            Event code 144 (KEY_FILE)
                            Event code 150 (KEY_WWW)
                            Event code 152 (KEY_SCREENLOCK)
                            Event code 155 (KEY_MAIL)
                            Event code 156 (KEY_BOOKMARKS)
                            Event code 158 (KEY_BACK)
                            Event code 159 (KEY_FORWARD)
                            Event code 161 (KEY_EJECTCD)
                            Event code 163 (KEY_NEXTSONG)
                            Event code 164 (KEY_PLAYPAUSE)
                            Event code 165 (KEY_PREVIOUSSONG)
                            Event code 166 (KEY_STOPCD)
                            Event code 167 (KEY_RECORD)
                            Event code 168 (KEY_REWIND)
                            Event code 169 (KEY_PHONE)
                            Event code 171 (KEY_CONFIG)
                            Event code 172 (KEY_HOMEPAGE)
                            Event code 173 (KEY_REFRESH)
                            Event code 174 (KEY_EXIT)
                            Event code 176 (KEY_EDIT)
                            Event code 177 (KEY_SCROLLUP)
                            Event code 178 (KEY_SCROLLDOWN)
                            Event code 181 (KEY_NEW)
                            Event code 182 (KEY_REDO)
                            Event code 206 (KEY_CLOSE)
                            Event code 207 (KEY_PLAY)
                            Event code 208 (KEY_FASTFORWARD)
                            Event code 209 (KEY_BASSBOOST)
                            Event code 210 (KEY_PRINT)
                            Event code 212 (KEY_CAMERA)
                            Event code 216 (KEY_CHAT)
                            Event code 217 (KEY_SEARCH)
                            Event code 219 (KEY_FINANCE)
                            Event code 223 (KEY_CANCEL)
                            Event code 224 (KEY_BRIGHTNESSDOWN)
                            Event code 225 (KEY_BRIGHTNESSUP)
                            Event code 228 (KEY_KBDILLUMTOGGLE)
                            Event code 229 (KEY_KBDILLUMDOWN)
                            Event code 230 (KEY_KBDILLUMUP)
                            Event code 231 (KEY_SEND)
                            Event code 232 (KEY_REPLY)
                            Event code 233 (KEY_FORWARDMAIL)
                            Event code 234 (KEY_SAVE)
                            Event code 235 (KEY_DOCUMENTS)
                            Event code 240 (KEY_UNKNOWN)
                            Event code 241 (KEY_VIDEO_NEXT)
                            Event code 244 (KEY_BRIGHTNESS_ZERO)
                            Event code 256 (BTN_0)
                            Event code 353 (KEY_SELECT)
                            Event code 354 (KEY_GOTO)
                            Event code 358 (KEY_INFO)
                            Event code 362 (KEY_PROGRAM)
                            Event code 366 (KEY_PVR)
                            Event code 370 (KEY_SUBTITLE)
                            Event code 372 (KEY_ZOOM)
                            Event code 374 (KEY_KEYBOARD)
                            Event code 376 (KEY_PC)
                            Event code 377 (KEY_TV)
                            Event code 378 (KEY_TV2)
                            Event code 379 (KEY_VCR)
                            Event code 380 (KEY_VCR2)
                            Event code 381 (KEY_SAT)
                            Event code 383 (KEY_CD)
                            Event code 384 (KEY_TAPE)
                            Event code 386 (KEY_TUNER)
                            Event code 387 (KEY_PLAYER)
                            Event code 389 (KEY_DVD)
                            Event code 392 (KEY_AUDIO)
                            Event code 393 (KEY_VIDEO)
                            Event code 396 (KEY_MEMO)
                            Event code 397 (KEY_CALENDAR)
                            Event code 398 (KEY_RED)
                            Event code 399 (KEY_GREEN)
                            Event code 400 (KEY_YELLOW)
                            Event code 401 (KEY_BLUE)
                            Event code 402 (KEY_CHANNELUP)
                            Event code 403 (KEY_CHANNELDOWN)
                            Event code 405 (KEY_LAST)
                            Event code 407 (KEY_NEXT)
                            Event code 408 (KEY_RESTART)
                            Event code 409 (KEY_SLOW)
                            Event code 410 (KEY_SHUFFLE)
                            Event code 412 (KEY_PREVIOUS)
                            Event code 416 (KEY_VIDEOPHONE)
                            Event code 417 (KEY_GAMES)
                            Event code 418 (KEY_ZOOMIN)
                            Event code 419 (KEY_ZOOMOUT)
                            Event code 420 (KEY_ZOOMRESET)
                            Event code 421 (KEY_WORDPROCESSOR)
                            Event code 422 (KEY_EDITOR)
                            Event code 423 (KEY_SPREADSHEET)
                            Event code 424 (KEY_GRAPHICSEDITOR)
                            Event code 425 (KEY_PRESENTATION)
                            Event code 426 (KEY_DATABASE)
                            Event code 427 (KEY_NEWS)
                            Event code 428 (KEY_VOICEMAIL)
                            Event code 429 (KEY_ADDRESSBOOK)
                            Event code 430 (KEY_MESSENGER)
                            Event code 431 (KEY_DISPLAYTOGGLE)
                            Event code 432 (KEY_SPELLCHECK)
                            Event code 433 (KEY_LOGOFF)
                            Event code 439 (KEY_MEDIA_REPEAT)
                            Event code 442 (KEY_IMAGES)
                            Event code 576 (KEY_BUTTONCONFIG)
                            Event code 577 (KEY_TASKMANAGER)
                            Event code 578 (KEY_JOURNAL)
                            Event code 579 (KEY_CONTROLPANEL)
                            Event code 580 (KEY_APPSELECT)
                            Event code 581 (KEY_SCREENSAVER)
                            Event code 582 (KEY_VOICECOMMAND)
                            Event code 583 (?)
                            Event code 592 (KEY_BRIGHTNESS_MIN)
                            Event code 593 (KEY_BRIGHTNESS_MAX)
                            Event code 608 (KEY_KBDINPUTASSIST_PREV)
                            Event code 609 (KEY_KBDINPUTASSIST_NEXT)
                            Event code 610 (KEY_KBDINPUTASSIST_PREVGROUP)
                            Event code 611 (KEY_KBDINPUTASSIST_NEXTGROUP)
                            Event code 612 (KEY_KBDINPUTASSIST_ACCEPT)
                            Event code 613 (KEY_KBDINPUTASSIST_CANCEL)
                          Event type 2 (EV_REL)
                            Event code 6 (REL_HWHEEL)
                          Event type 3 (EV_ABS)
                            Event code 32 (ABS_VOLUME)
                              Value      0
                              Min        0
                              Max      908
                          Event type 4 (EV_MSC)
                            Event code 4 (MSC_SCAN)
                        Properties:
                        Testing ... (interrupt to exit)
                        Event: time 1597347865.699200, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
                        Event: time 1597347865.699200, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
                        Event: time 1597347865.699200, -------------- SYN_REPORT ------------
                        Event: time 1597347865.851171, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
                        Event: time 1597347865.851171, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
                        Event: time 1597347865.851171, -------------- SYN_REPORT ------------
                        Originally posted by ralphy
                        Currently a long press of the Fn (function) key saves to the presets and pressing an Fn key selects it.
                        I am aware of this, and this works well for standard PC keyboards that have a full set of Fn function keys. However this model T3 Air-Mouse RC has only 5 function keys F3 to F7 (refer to picture in post #4), and these keys are not recognizable as Function keys (and they don't have a number). So for this particular RC and similar models it would be more convenient and intuitive if presets can also be set by long pressing numerical keys 0 to 9. It was just a thought and I can understand that this feature is not on top of your todo list
                        Last edited by CJS; 2020-08-13, 21:25.
                        | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

                        Comment

                        • CJS
                          Senior Member
                          • Dec 2018
                          • 2168

                          #13
                          Originally posted by Howard Passman
                          I, for one, would like to thank you for this primer.
                          Thank you very much.
                          Howard
                          You are welcome.
                          | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

                          Comment

                          • CJS
                            Senior Member
                            • Dec 2018
                            • 2168

                            #14
                            Response on pressing POWER button

                            One more question about the response of Jivelite/LMS on pressing button KEY_POWER on my RF/USB remote control. The response on pressing this button is not as I expected.

                            I made following observation:
                            In file InputToActionMap.lua, keys["q"] and [KEY_POWER] are both mapped on action "power":

                            charActionMappings.press
                            ["q"] = "power",

                            keyActionMappings.press
                            [KEY_POWER] = "power",

                            Yet the reaction of LMS on pressing q and pressing KEY_POWER appears to be different:
                            • pressing q toggles power (pressing q first time => power off, pressing q again => power on)
                            • pressing KEY_POWER gives power off (pressing KEY_POWER first time => power off, pressing KEY_POWER again => player stays off).
                              To power the player on after pressing KEY_POWER I need to press a different key, for example a numerical key or the KEY_HOMEPAGE button.

                            My preference would be that pressing KEY_POWER toggles power.
                            Question to Raplhy: Can it be explained why pressing the POWER button results in a different action than pressing q?

                            For completeness the full output of evtest on pressing KEY_POWER after selecting event2 is given below:
                            Code:
                            sudo evtest
                            No device specified, trying to scan all of /dev/input/event*
                            Available devices:
                            /dev/input/event0:      FREEWAY TECHNOLOGY RFIC-MOUSE Keyboard
                            /dev/input/event1:      FREEWAY TECHNOLOGY RFIC-MOUSE Consumer Control
                            /dev/input/event2:      FREEWAY TECHNOLOGY RFIC-MOUSE System Control
                            /dev/input/event3:      FREEWAY TECHNOLOGY RFIC-MOUSE
                            /dev/input/event4:      FREEWAY TECHNOLOGY RFIC-MOUSE
                            Select the device event number [0-4]: 2
                            Input driver version is 1.0.1
                            Input device ID: bus 0x3 vendor 0x25a7 product 0x2402 version 0x101
                            Input device name: "FREEWAY TECHNOLOGY RFIC-MOUSE System Control"
                            Supported events:
                              Event type 0 (EV_SYN)
                              Event type 1 (EV_KEY)
                                Event code 116 (KEY_POWER)
                                Event code 139 (KEY_MENU)
                                Event code 142 (KEY_SLEEP)
                                Event code 143 (KEY_WAKEUP)
                              Event type 4 (EV_MSC)
                                Event code 4 (MSC_SCAN)
                            Properties:
                            Testing ... (interrupt to exit)
                            Event: time 1597609964.535842, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10081
                            Event: time 1597609964.535842, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
                            Event: time 1597609964.535842, -------------- SYN_REPORT ------------
                            Event: time 1597609964.686864, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10081
                            Event: time 1597609964.686864, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
                            Event: time 1597609964.686864, -------------- SYN_REPORT ------------
                            Thanks in advance for your reply, and I hope that I am not asking too much of your time.
                            | LMS 8.5.1 on Linux Mint 21.3 | Squeezebox Boom | RPi0W + pCP 8.2.0 + HiFiBerry DAC Zero | ESP Muse Luxe |

                            Comment

                            • ralphy
                              Senior Member
                              • Jan 2006
                              • 3229

                              #15
                              First thanks for the keycode for the KEY_PLAYPAUSE. A generic key symbol is already defined for it in SDL, so I should just need to update the jive_framework.c file to map it.

                              KEY_POWER has several special handlers in jivelite, where as KEY_Q does not follow the same code path.

                              You should be able to fix the KEY_POWER behaviour in jivelite go to settings->picoreplayer->enable power on button when powered off and save and restart jivelite.
                              Ralphy

                              1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                              Squeezebox client builds donations always appreciated.

                              Comment

                              Working...