applescript – How do I allocate a keyboard to a specific app

I’m searching for an app or script that would allow me to have two keyboards connected to my Mac.
One would be for normal usage and the other one should be allocated to a specific app. I think it could be very handy especially if you have to change between different apps all the time and don’t want to use cmd + tab.

I often have to watch videos and like many others I control them via “Video speed controller” which allows me to advance, rewind, pause, increase and decrease speed and many more. Likewise, I thought about getting a “half keyboard” with which this could be possible and also pretty cheap.

Is there any chance to make this happen?