Samsung remote (CEC) Long-press working in Android but NOT in Kodi
#16
Well, that's at least a bit of an explanation as opposed to it does not work...period.

But....my experience with a previous TV's and CEC remotes (LG and Philips), it did work within Kodi. No problem with a long-press recognition.
So if long-press recognition is possible somehow, can it be done with the minimalist Samsung remote. Or can a developer/programmer investigate why it does for some remotes and not for others?

@Riceyepie
On previous used remotes, I could also remap buttons within Kodi  to perform actions I would like. Sadly the minimalist Samsung "one" remote does not have a Red button or any other 'spare' button to configure. Only directional, back and OK are remappable. But I you've found solution, I'd very much like to hear it.
Reply
#17
Hi, I faced the same problem with the remote of my Samsung TV (QN95B Neo QLED 2022) and its limited buttons. I read in some of the older posts, that Kodi doesn't recognize long-press buttons when using CEC. However, with my old remote of the Xioami Mi Box S, when I was in 'Full Screen Video' I always managed to change the language or the subtitles with a long-press of the 'Up' or 'Down' buttons. I've checked the documentation and I've found these entries:

<keymap>
 <FullscreenVideo>
    <keyboard>
      <up mod="longpress">AudioNextLanguage</up>
      <down mod="longpress">NextSubtitle</down>
    </keyboard>
</FullscreenVideo>
</keymap>

With Samsung's One Remote this characteristic it's not lost. I still can change the audio/subtitle with a long-press. So, in some strange way, Kodi does recognize these actions.

So I created a gen.xml using the down key (it also works with, up, right or left):

<keymap>
 <global>
    <keyboard>
      <down mod="longpress">contextmenu</down>
    </keyboard>
</global>
</keymap>


I think it's the quickest way to call the context menu, and it's probably the best solution for most people. However, if you have a large library and you use the long-press down button to navigate within the files, then it might not be the best solution for you.
Reply
#18
Good find! I've only been focusing on the Enter/OK button. Never looked at the directional buttons...

Those are the only buttons that support some sort of a repeat function and therefore a support a possible long-press functionality. The 'Ok' and 'Back' button do NOT.
You can check that using the Keyevent Display app (from the playstore).

The directional buttons show a obvious repeat but 'Ok' button only generates a single press. The 'Back' button however, behaves very different. It registers no repeat but just a single press. If you hold it, it registers value 28, which is different from the original 4 value. Initially, I thought I could remap the 'back' long-press to something. Sadly, the 28 stands for the 'Clear' key (on MAC keyboards) and has no Android equivalent. It won't register in any button remap tools out there (Kodi or Android).

The only way - as you found - is a directional button long-press remap to show the context menu. As you said, that can be troublesome browsing large listings. But it depends on your used Kodi skin. If you have a horizontal orientated layout, you can remap the UP or DOWN to show the context menu. When browsing through vertical listings, remap the RIGHT or LEFT.

This is what I ended up with (at this moment). Using the Arctic Horizon 2 skin (horizontal orientated Home) and when in library lists (vertically), I swap the context menu.
I use this keymap.xml for several remotes. The 'key id' entries are needed for the Samsung remote (numbers generated by the Kodi Keymap Editor). For instance, the Samung remote generates the number 61448 when using the back button and my other remote Browser_back.

Code:
<keymap>
 
  <Home>
    <keyboard>
      <down mod="longpress">ContextMenu</down>
      <up mod="longpress">Info</up>               
    </keyboard>
  </Home>
 
  <Videos>
    <keyboard>
      <left mod="longpress">Info</left>
      <right mod="longpress">ContextMenu</right>
    </keyboard>
  </Videos>

  <Fullscreenvideo>
    <keyboard>
      <down>osd</down>
    
      <key id="61448">Stop</key>
      <browser_back>Stop</browser_back>

      <down mod="longpress">NextSubtitle</down>
      <up>ActivateWindow(subtitlesearch)</up>
      <up mod="longpress">SubtitleDelay</up>

      <pageup>SubtitleDelayPlus</pageup>
      <pagedown>SubtitleDelayMinus</pagedown>
      
      <fastforward>ZoomIn</fastforward>
      <rewind>ZoomOut</rewind>
      <key id="61637">ZoomIn</key> 
      <key id="61636">ZoomOut</key>

    </keyboard>
  </Fullscreenvideo>

  <VideoPlaylist>
    <keyboard>
      <left mod="longpress">Delete</left>
    </keyboard>
  </VideoPlaylist>

  <Filemanager>
    <keyboard>
      <right mod="longpress">Highlight</right>                                                                                   
      <left mod="longpress">Delete</left>
    </keyboard>
  </Filemanager>
 
  <FileBrowser>
    <keyboard>
      <right mod="longpress">Highlight</right>                                                                                   
      <left mod="longpress">Delete</left>
    </keyboard>
  </FileBrowser>
 
  <Favourites>
    <keyboard>
      <right mod="longpress">Highlight</right>                                                                                   
      <left mod="longpress">Delete</left>  
    </keyboard>
  </Favourites>
</keymap>


Why the standard Android TV launcher DOES recognize a 'OK' button long-press (re-order the menu) and Kodi does not, remains a mystery to me...
Reply
#19
For me the solution was to utilize the 'back' longpress as follows:

<?xml version="1.0" encoding="UTF-8"?> <keymap> <Home> <remote> <clear>ContextMenu</clear> </remote> </Home> </keymap>
Reply
#20
Used your xmlcode:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
   <Home>
     <remote>
       <clear>ContextMenu</clear>
     </remote>
   </Home>
</keymap>
The <clear> entry in the xml code should interact with the [back] button? Sadly it does not work for me. Are we talking about the same remote (black/silver)? And how did you name .xml?
Image
Reply
#21
FYI, with the keymap editor I'm able to map the back longpress to the contextual menu. It wasn't working until I added the shortcut for all windows.
Reply
#22
Could you please share your xml code (gen.xml)?
Reply

Logout Mark Read Team Forum Stats Members Help
Samsung remote (CEC) Long-press working in Android but NOT in Kodi0