Why the shortcut action is run immediately when pressed but not when released the key?

Hi,
After some time I decided to write here. But I would like to ask somewhere else as I think it is a bug.

I am using all computers windows and linux. In windows there is no problem to set any kind of shortcuts and they are not influence each other if you have diiferent comibnations.
But in Linux there is one big problem with it.
When you set up the ALT-SHIFT then the action will happen immediately after you press the keys.
I think that is just wrong behaviour. Because then the system cannot know if you would like to press third key!
And also it interfere with the othe combination. When you press ALT+TAB and then leave the TAB and still pressing the ALT. Then you can press SHIFT+TAB. This is working only in case you do not set “anything” to the combination “ALT+SHIFT” or “CTRL+SHIFT”.

I think the right process should be that the action should run not immediately after you press the SHIFT but after you will release the SHIFT key.

So the question is really "why the action is run immediately when the key is pressed and not when the key is released?

Can it be fixed?

Thanks for explanation.
Vlada

If the alt-shift key combo is triggering an action then that key combo would appear to be mapped to some action within the settings for the keyboard. This would mean that any action mapped to the alt-shift would occur before the 3rd key could be pressed. To avoid that one would need to change the sequence of key presses to press the keys in the order of alt-key-shift or shift-key-alt. This shows either an error in using a key mapping or operator error in the sequence used.

The keys are and always have been mapped to act when they are pressed and not when released.

The only action that I am aware of where releasing a ‘key’ is that within some apps (notably python or qt) is that actions can be mapped to happen when the mouse key is released. The keyboard however is by default mapped for press.

Theoretically this could be changed but is way beyond the average user since the key press is seen before the release is possible and one would need to (within the software) ignore the key press to take advantage of the release.

Thanks.
So I am wrong. You are right the action is or must be run immediately after the key is pressed.
Then I still have a problem why windows can handle this ok and linux not.
In windows you have ALT+SHIFT set to change the keyboard layout and then ALT+SHIFT+TAB to change the the windows in back order and it works fine.
In Linux this does not work. If you will try to press ALT+SHIFT+TAB, it will always change the keyboard layout and the third tab pressing key will not work.

What is the reason for this?

Best Regards
Vlada

This is not always the case. For example, in SwayWM, you can set an action to perform when a key or key combination is released, not when they are pressed.

It’s been a while since I have used Windows, but I can confirm that macOS works the same as Linux, i.e. triggering the action on key press and not on key release. A simple test would be to cycle between the open tabs of a browser with Ctrl+Tab. Pressing (but not releasing) this key combination triggers cycling through the browser tabs indefinitely, both on Linux and macOS, and my guess is, on Windows too (but I may be wrong here).

It would be best if you could choose a keyboard shortcut which wouldn’t interfere with other shortcuts. Or to stick with the default one, which in case of GNOME is Super+Space.

2 Likes

if you are on Gnome, Alt is not set up as a modal key.

FWIS :

Gnome Desktop Shortcuts Super is the modal key enabling the 3rd key.

Ctrl+Alt would enable a 3rd key like Delete and hence be modal.

I do not see a way to have Alt +Shift+1 :thinking:

You would need Ctrl and/or Super

You can set this up yourself if you need to from :


If you are Browser Power User, this could interfere with the browser.

Check out the Firefox Shortcuts list for the extensive use of Alt & Ctrl

A WM like Sway / i3WM might not have this restriction as they are not typical Desktop Environments.


On Gnome :

  • You would need to tweak these settings if you are using multiple keyboard layouts. Which would require you to set the key for the switch.

1 Like

Thanks to all. I wanted to be sure so I have logged to Windows and I can confirm that the ALT + SHIFT is not trigged the acction immediately. So this is really the difference and this is why it works in Windows and not in Linux.
So they just difference this ALT key.
When I press the CTRL + TAB then the action is triggered immediately.
I think the behaviour that Linux does not take into account the ALT key as modal or 3rd key is just wrong.

As I understand all keyboards have ALT, CTRL, SHIFT and WIN or SUPR or anything else new as a modal keys.
When you press any of these keys or a combinations you chould not run any action immediately. Only when you release some key.
I think this behaviour is wrong and make a lot of problems in using shortcuts in linux.

Do you agree? I do not want say that windows is work correctly but in this case the linux is wrong as my understanding.

If you agree is it possible to send somewhere the enhancement reqeust? If not then ok :).

Have nice day
Vlada

Sorry, I do not agree. The desktop paradigm is different. Microsoft/Windows has done this for as long as I can remember (Windows 3.X days). Unix/Linux has a history of some of these keys being used in that fashion for many reasons. Editors being Prime reason for certain key strokes.

The Alt key itself is the same on both Windows and Linux systems – it’s a modifier key used in combination with other keys to perform specific actions. However, there are some key differences in how the Alt key is used by default:

Windows:

  • Primary modifier for menu shortcuts: In Windows, Alt is the main key for accessing menus and activating menu shortcuts within applications. For instance, Alt+F often opens the File menu, and Alt+F4 closes the current program.
  • Not used for window management: By default, Windows doesn’t use the Alt key for window management tasks like moving or resizing windows.

Linux:

  • Shared role for shortcuts: Alt is used for some application shortcuts, but it shares this role more with the Ctrl key than in Windows.
  • Window management: On most Linux desktops, holding Alt while clicking and dragging a window allows you to move it. This function isn’t built into Windows by default.

There are other historical facts to share abouot this. Although, If you wanted your type of behavior you could try a different Spin of Fedora Sway or Fedora i3WM, where you could modify the shortcuts more freely. As Window managesment is far different there.

1 Like

It would seem your perspective is that the way windows does things should be the way all different DEs should be organized. This is a windows centric view and would imply that only the windows way of doing things is correct.

Linux is not windows, never has been, and though many things are similar (clipboard management is one example) there are different ways of doing the same tasks that seem appropriate to other users.

If you wish to use linux, please do so, but do not demand that everything in linux is performed exactly the same way as you are used to when using windows.

Many things are different and you should either get used to the differences or go back to the proprietary and restricted way of doing things.

1 Like