I'm working on a computer with two keyboards and two users. They are using different layouts. The two keyboards are identical. [Their device ID can be found easily with `xinput`](http://superuser.com/a/294034/2259), but when typing we can't tell them apart. Therefore, when setting the alternative layout, we have to just try one and revert and try the other one it if it doesn't work. **Is there some way to find the keyboard ID, as understood by `setxkbmap -device`, when typing?** Ideally it would be a command which sets the layout on the keyboard where the next event comes from. I tried `xev`, but that doesn't seem to indicate which keyboard device actually sent the event.