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...