Allow different Input Remaps per application
I use a pen tablet and it would be nice if my tablet buttons did something different in ApplicationA versus ApplicationB versus ApplicationC... and maybe have a "global" Input remap for when the active application is not anything specific.
I did some googling and apparently this is not possible for Wayland in general; however different Desktop Environments each have their own method of fetching the currently active window, so this feature may not be that simple to implement.
I suspect it would be easier for you to develop a practical solution if you describe your project precisely. By this I mean that you list which input and output values buttons you want in which scenarios in ApplicationA, ApplicationB and ApplicationC.
houmain/keymapper can do it.
Perhaps inspiration could be taken from there.
As correctly said, support from the compositor (e.g. KWin) is needed in order to get information about the active application.
My use case: mapping the scroll wheel tilt to 'back' and 'forward' in browsers, and to 'undo' and 'redo' in editors.