Button to deliver keyboard events to window

In some cases, there could be a need to send keyboard events to window instead of to desktop environment. For example, ALT+TAB in VM and ALT+TAB in Kwin.
I think there should be an button, when it was pressed, next keyboard combination will be send to active window.
Some GNOME programs could use this and VM could use this, especially when ran KWin in VM and DE of host is Plasma.

For VM purposes, there should be additional layer of complexity. This button should have two modes:

  1. Normal press
  2. Long press

When normal press, Host system will remember next keyboard combination will be send to active window, but no next click of this button. So user could use many layers of VM. When long press, next press on this button would behaves again normally, so it will work as fast reset event.

What do you think?

Dunno if I understand it correctly but, you can always make a desktop app that executes an xdotool or kdotool command.

For example. Since I use a lot of apps without toolbars I have this little launcher that executes alt+left.

I think it’s about a global shortcut that tells kwin to ignore the next global shortcut (so that the active window will receive it).
This might actually be useful in some cases, although partially as a workaround for applications that don’t let you configure their shortcuts.

As for solutions to specific use cases:

  • VM / RDP clients usually have a “Host” key, that (un)grabs all input.
  • for working with VMs you might want to take a look at evsieve
1 Like

Yes. My idea was about disable next global shortcut. For example, Plasma developers in the past have switched some shortcut from ctrl+alt (or alt) modifiers to super key, because GIMP use this modifiers in one’s shortcut. But this is rather not systematic solution, but rather hack. What about different apps use other shortcut Plasma is using in different purposes?

I wrote example about running OS in VM, which ran Plasma6, and on host we ran Plasma6. Currently, even ALT+TAB are redirected to VM - we must click on another window or move cursor above another window to send keyboard combination globally. This idea solves it, but have some drawbacks, like user might think in some cases, that ALT+TAB will be send to VM per default.