Long press support on the OSMC remote

The long press support works out of the box. We don’t have any sane defaults yet so they will fall back to Kodi’s default configuration.

If you upload a log or provide an order number we can tell you if it is a new or old model.

Thank you, I’ve opened a support request with the details.

Probably the best/easiest ways to get started is to program any short press buttons with the keymap editor add-on. Once you have that sorted you can either manually edit the gen.xml file that add-on created, or make a second keymap file (what it is named doesn’t matter). Unfortunately the keymap editor add-on does not support longpress and as such if you edit gen.xml then any future changes in the add-on will delete your changes. If you use a second keymap file for your longpress settings the add-on will not destroy these, but it will rename the file and you might have to rename your custom file.

As far as manually adding the longpress commands it is the same as programing normal buttons, just with the addition of mod="longpress" to the button identifier. The following is working example of a keymap file programed for the new remote. In this example the longpress just brings up a notification alert.

Keymap Example
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
	<global>
		<keyboard>
			<escape mod="longpress">Notification(Home,,)</escape>
			<i mod="longpress">Notification(Info,,)</i>
			<up mod="longpress">Notification(up,,)</up>
			<down mod="longpress">Notification(down,,)</down>
			<left mod="longpress">Notification(left,,)</left>
			<right mod="longpress">Notification(right,,)</right>
			<return mod="longpress">Notification(OK,,)</return>
			<browser_back mod="longpress">Notification(Back,,)</browser_back>
			<c mod="longpress">Notification(Menu,,)</c>
			<play_pause mod="longpress">Notification(Play,,)</play_pause>
			<stop mod="longpress">Notification(Stop,,)</stop>
			<minus mod="longpress">Notification(Vol-,,)</minus>
			<equals mod="longpress">Notification(Vol+,,)</equals>
		</keyboard>
	</global>
	<home>
		<keyboard>
			<i mod="longpress">Notification(Info,,)</i> <!-- has to be mapped here seperatly -->
		</keyboard>
	</home>
</keymap>

EDIT: The keymap I posted above will not currently be entirely correct as a couple of the key id’s for that remote are currently different right now than what we plan on them being in the near future. If you use keymap editor it will show you what the correct id number is currently.

EDIT 2: I updated the keymap example with something easier to read and with mapping that work at the time of writing this. It is worth noting that if you map a longpress to a key it disables key repeat for that button. This mean that most people would probably NOT want to set a global longpress like I posted above for the direction and volume keys. I included those for reference as they may be useful in mappings for specific screens.

Thank you I will try this.

EDIT: Used the addon to find the key ids but the longpress doesn’t work. I guess I got an older remote, still waiting for the support’s answer.

If you try to program a button to the ‘up’ direction button in keymap editor does it come back with a key id of 61568? If so then it’s the new remote.

Nope, all button’s has a 3 character key id. I’ve tested with this below, the notification came up if I had removed the longpress config.

Can I adapt this remote to work somehow?

<keymap>
<global>
	<keyboard>
		<key id="209" mod="longpress">Notification(VolumeDown Long,asd,1)</key> <!-- Volume Down/F9 -->
		<key id="208" mod="longpress">Notification(VolumeUp Long,asd,1)</key> <!-- Volume Up/F10 -->
		<key id="209">Notification(VolumeDown,asd,1)</key> <!-- Volume Down/F9 -->
		<key id="208">Notification(VolumeUp,asd,1)</key> <!-- Volume Up/F10 -->
	</keyboard>
</global>

I believe that is the old remote that runs through lirc which keeps longpress from working. @sam_nazarko has said that he knows how make this happen, and is planning on making that change though. Personally I know little about lirc and don’t own one of those remote to experiment with, so i’m of little help here. I know there are posts on other forums that describe several methods of disabling lirc across the board which apparently allows certain remotes to work with longpress, but I really don’t want to post information I don’t know the repercussions of and have not tested myself.

FYI the <!-- comments --> are not necessary in the keymap file. I just put them for my own edification during testing. They are also not entirely correct as the vol, info, and menu keys are not currently remapped to F-keys.

For the old remotes, we will remove eventlircd and transition to a HWDB approach to support long press on all of our remotes

Sam

4 Likes

I think i’m pretty close to what should be a significant improvement for all versions of the OSMC remote. I have included maps from quite a few suggestions in this thread. If there is any new suggestions then now would be a good time to post them. Suggestions do not have to be constrained to just longpress actions.

In particular I am interested in suggestions regarding the streaming TV section. I have never used this feature so if there is something to be improved or added with remote mapping please explain. Suggestions should specify which screen lacks which button mapping. The different TV screens are…

TVChannels
TVRecordings
TVTimers
TVTimerRules
TVGuide
FullscreenLiveTV

Home (from everywhere): go to main menu
Home (from main menu): go back to currently playing video (ToggleFullscreen if I remember correctly), this doesn’t do anything if already on home screen.

Long press home: stop all playing media and go to standby

Long press vol-: toggle mute

2 Likes

My current plan is for the home button to go to the home screen except where overwritten on a particular screen. When on the home screen that button sends a command to turn on via CEC and longpresses to turn off via CEC. This allows power control for both Vero’s and RPi’s without having the button become useless when not being used for on/off functions.

I had given thought to the suggestion of adding mute but my issue is that i’m loath to disable key repeat for either volume button as a default option as I think many would find this to be undesirable. Anyone would of course be able to add this themselves as a custom keymap which is fairly easy to do.

The back button brings you to fullscreen playback when you’re in the home screen. Mapping this function to long press home would be redundant.

There are two functions I do on a regular basis, which I would love a Long Press for.
The first is that if I want to toggle subtitles on and off, I have to do six presses just to be able to get to where I can do a seventh press to turn On/Off.

The second is that if I want to toggle Audio to allow/disable Passthrough, it takes 11 to get to where I press again, to toggle allow/disable.

I would like a long press button for each one, to bring me to the option where the next press, toggles.

Two presses on the Back/Return button gets me back to what I am watching, which is fine.

The current plan is that during full screen video playback a longpress of the play button toggles subs on/off and a longpress of the stop button selects the next available subtitle.

As for the passthrough audio, that seems like something too niche to be a default mapping. This would be more appropriate as something you set yourself in a custom map (that action you would be mapping is “audiotoggledigital”).

That’s fine for the Subs. I plan to buy a Vero 4K for the lounge and the original will go in the bedroom, which will take care of my particular audio requirements.

I’ve mapped it to the home button, not long press home. This way, home allows me to toggle to go to the home menu and back to the video. Works quite intuitive.

This is a highlight of my current plan for the new default mapping for all versions of the OSMC remote. I’m only listing things that are outside of stock Kodi (keyboard) behavior. This is all subject to change. I would appreciate thoughts, suggestions, and feedback.

Home - Set globally to return you to the home page with a single click. Longpress set globally to the fullscreen action (from the home screen back takes you to fullscreen as the one exception). Once you are on the home screen pressing it will send CECactivatesource, and longpress sends CECstandby. This allows for this button to act as a power/switch source button on both Vero and RPi’s if you use CEC.

Info - Longpress during fullscreen video turns on/off the debug log and its overlay.

OK - Longpress during fullscreen video brings up the playlist. When in the video library longpress will toggle the view between all videos and unwatched videos. Longpress on home screen reloads skin (useful for MySQL users). For text input longpress activates the OK button to finish text input.

Up - For text input longpress will press shift (upper/lower case). For fullscreen video longpress is set to next playlist video.

Down - For text input longpress will toggle symbols. For fullscreen video longpress is set to previous playlist video.

Menu - Set longpress global to open the side/slide menu. During fullscreen video it will toggle playerprocessinfo to emulate the old remote behavior, and longpress will bring up the chapter/bookmarks screen.

Play - During fullscreen playback longpress toggles subtitles.

Stop - During fullscreen playback longpress selects next subtitle.

1 Like

a longpress for the screenshot function would be cool

That would be nice. The only issue I see is that it would have to be global and where do we put it? Keep in mind that longpress disables repeat so a global longpress to vol or direction buttons is a big no no.

Things I use a lot:

  • Bring up the audio offset screen (from fullscreen video).
  • Bring up subtitle offset screen (from fullscreen video).
  • Go into Standby mode (esp. from Home screen).

One I would like would be a toggle between Normal and Original Size video modes.

2 Likes