How to completely disable IR remote button in kodi

I’ve successfully used irexec to receive my MCE remote outside of kodi, which controls the volume on my AVR by running a script.

Now I want to completely disable those volume keys from being registered by kodi, so I can press them and the screensaver continues to run.

I have tried putting noop’s in the keymap, and also putting nothing in the keymap.

<keymap>
    <global>
		<keyboard>
			<key id="208">noop</key>
		</keyboard>
    </global>
</keymap>

I can see that my entries are affecting what kodi does, but anything I enter (even noop!) still registers as activity in kodi and stops the screensaver if it is running.

2025-07-24 15:25:45.632 T:2991    debug <general>: LIRC: - NEW 73 0 KEY_VOLUMEUP devinput (KEY_VOLUMEUP)
2025-07-24 15:25:45.634 T:2987    debug <general>: bool CInputManager::HandleKey(const CKey&): leftctrl (0xd0) pressed, window 10000, action is

I can get the button to not do anything, I just can’t get it to not stop the screensaver from running.

I have also tried a custom Lircmap.xml in the userdata folder with this:

<lircmap>
	<remote device="devinput">
		<noop>KEY_VOLUMEDOWN</noop>
	</remote>
</lircmap>

and also removing that key completely from the file, but I see there is another Lircmap.xml in /usr/share/kodi/system/Lircmap.xml, so I think if the key is removed from my /storage/.kodi/userdata/Lircmap.xml then it uses the one in /usr/share/kodi/system/.

So I would like to try removing those keys from /usr/share/kodi/system/Lircmap.xml, but it seems I can’t edit that because it is readonly.

How can I can edit or completely override that file?

Looks like all the keys even without action disables screensaver. No idea if this behaviour can be change.

I was hoping there was some way I could prevent the key from even getting to kodi.

You don’t happen to know how I can edit usr/share/kodi/system/Lircmap.xml though?

I’d like to try removing the keys from that file.

/storage/.kodi/userdata/Lircmap.xml ?

I want to specifically edit usr/share/kodi/system/Lircmap.xml, because I believe the keys that are not present in /storage/.kodi/userdata/Lircmap.xml are being found in usr/share/kodi/system/Lircmap.xml.

So I want to remove the keys from both files.

Copy whole file to /storage one and make changes there?

I don’t think you’re understanding what I’m trying to do.

I want to remove the recognition of the key from kodi.

I believe that when there’s a key that is not present in /storage/.kodi/userdata/Lircmap.xml, kodi still uses it’s mapping from /usr/share/kodi/system/Lircmap.xml.

So if I do as you said and copy that file to storage and then remove a key, kodi will still use the mapping from usr/share/kodi/system/Lircmap.xml.

I do not want that to happen.

You can try this and see if makes any change.

# stop kodi
systemctl stop kodi

# copy file from usr to storage
cp /usr/share/kodi/system/Lircmap.xml /storage/downloads

# edit file /storage/downloads/Lircmap.xml

# mount bind file from storage to usr
mount -o bind /storage/downloads/Lircmap.xml /usr/share/kodi/system/Lircmap.xml

# start kodi
systemctl start kodi
1 Like

Very tricky!!

I wouldn’t have thought of using a bind mount for that.

Unfortunately it didn’t work!

2025-07-24 19:42:38.944 T:12309   debug <general>: LIRC: - NEW a1 0 KEY_EJECTCD devinput (KEY_EJECTCD)
2025-07-24 19:42:38.960 T:12305   debug <general>: bool CInputManager::HandleKey(const CKey&): 0 (0x0, obc255) pressed, window 10000
, action is

Seems it stops the screensaver on any activity from LIRC.

But thanks for helping me try!!

There is one hacky way: making some simple daemon in python or in c which would open input device, swallow some keys (volume up or down), and put other keys out unchanged to new virtual input device. And kodi would not even get some keys.

Let me see if I can cook something up.

Which CE image you are using?

That would be awesome!

NO nightly on X96 X10 8Gb.

There’s a few other keys I use (mute, record and ejectcd) for other functions that I don’t want to get to kodi either.

But I’m sure if I see your code I should be able to add them.

Maybe there is easier way.

# stop kodi
systemctl stop kodi

post url you get by

libinput list-devices | paste

then

libinput debug-events

and press volume up and down keys and you should get some output, copy it to post here with url above

I do have one program working which eats keys as last option :slight_smile:

https://paste.coreelec.org/PointsRefusing

-event3   DEVICE_ADDED                 input_btrcu                       seat0 default group1  cap:k
-event2   DEVICE_ADDED                 input_ethrcu                      seat0 default group2  cap:k
-event4   DEVICE_ADDED                 XING WEI 2.4G USB USB Composite Device seat0 default group3  cap:k
-event5   DEVICE_ADDED                 XING WEI 2.4G USB USB Composite Device Mouse seat0 default group3  cap:p left scroll-nat scroll-button
-event6   DEVICE_ADDED                 XING WEI 2.4G USB USB Composite Device Consumer Control seat0 default group3  cap:kp scroll-nat
-event7   DEVICE_ADDED                 XING WEI 2.4G USB USB Composite Device System Control seat0 default group3  cap:k
-event1   DEVICE_ADDED                 vad_keypad                        seat0 default group4  cap:k
-event0   DEVICE_ADDED                 cec_input                         seat0 default group5  cap:k

Nothing came up when I pressed volume up and down, I had to press Ctrl-C to end.

I’m using a USB MCE receiver, not the inbuilt IR receiver on the box, if it makes a difference. There’s also a USB BT receiver for a G20s BT remote that I’m not using.

Did you stop kodi before?

yes, I did. Should the MCE receiver show up on that list? Because I don’t see it there.

I assure you it is working though. “She who must be obeyed” is using it right now, after I restarted kodi.

edit: the video on it just froze. Let me reboot and try again.

“She who must be obeyed” is not happy, lol.

libinput allows to disable some keys using hwdb rules. But if your USB device is not visible then …

Then hacky approach it is.

save program to your device

wget -O input_keys_eater https://test.coreelec.org/vpeter/input_keys_eater
chmod 755 input_keys_eater

stop kodi

systemctl stop kodi

run program with correct input device

./input_keys_eater /dev/input/eventX KEY_VOLUMEUP,KEY_VOLUMEDOWN

in another terminal start kodi

systemctl start kodi

and should work as you want (volume keys should not come to kodi)

Sorry, I really appreciate the work you’ve put in, but I don’t know what /dev/input/eventX to use - the remote I’m using doesn’t show anything.

Put kodi in debug mode, restart it and you will get some names (I hope).

cat /storage/.kodi/temp/kodi.log | grep -i input