Alt-Return shortcut not working

Started by weolvi, December 28, 2021, 10:48:49 AM

Previous topic - Next topic

weolvi

First of all, thanks to the developers for the nice christmas update to v2.8.0! Unfortunately, the keyboard shortcut Alt-Return (for the Information menu item that opens the Properties dialog) is not working on the pre-compiled appImage. My system is a stock Ubuntu 20.04 with the standard Gnome surface. The shortcut also didn't work on the 2.7.8 appImage but back then I had hoped that this would be discovered and fixed with the next update.

If you need more info on my setup (or somebody to test the fix :-) please let me know!

Wolfgang

eumagga0x2a

Does it work when you launch appImage in a console with language set to US English?

LANG=en_US.utf8 ./avidemux_2.8.0.appImage
(you must have cd into the directory containing the appImage prior to running this, of course.)

weolvi

Turns out that I already had LANG set to en_US.UTF-8 by default, so "No".

Inspired by your question I also looked at whether the shortcut was used by Gnome for something else or whether changing the keyboard layout from German to English made a difference, but neither helped.

Maybe it's because my computer is a laptop and thus has only one Alt key (the left one)?

eumagga0x2a

I suspect that your "Return" key is configured not as Return key but as the Enter key, usually found on keypads of full-size keyboards. Qt actually differentiates between the both.

eumagga0x2a

Please see https://doc.qt.io/qt-5/qt.html and search for "enum Qt::Key". There is Qt::Key_Return we use with the Qt::AltModifier to trigger the action which shows the properties dialog and Qt::Key_Enter which are not the same. The official appImage with a video loaded opens the properties dialog when I press Alt+Return, but not when I press Alt+Enter (the one on the keypad) – it works as designed.

weolvi

Sounds reasonable. Is there a way for me to find out if my Return key is actually an Enter key? I couldn't find any program that displays Qt key events.

eumagga0x2a

Quote from: weolvi on December 28, 2021, 11:08:15 PMIs there a way for me to find out if my Return key is actually an Enter key?

I think, you can take it for granted, but gnome-control-center allows to display keyboard layout for each input method. By the way, GNOME image viewer eog uses Alt+Return to open image properties dialog too, works with the real Return key, doesn't work with the Enter key.

While it should be trivial to catch Alt+Enter in the event filter and call the same action as for Alt+Return, this would be sort of an ugly hack as the current design allows to specify only a single keyboard shortcut for an action. If you are fine with building Avidemux from source, I'll post a private patch later.

weolvi

Using gnome-control-center I was able to see that the physical Return key is (incorrectly?) mapped to Enter. So it seems that my trouble is not due to avidemux but to blame on either a badly chosen keymap or on HP for having the two keys mixed up (as I have said said before, this is a laptop without a keypad -- not even one painted on to use with the Fn key).

From my perspective, the correct solution is not to patch avidemux but to fix the keyboard layout because this would address similar problems with other programs (such as eog). Since this is probably off-topic in this forum I regard the topic as closed.

Thank you very much for the quick help!

weolvi

Actually the solution is so simple that I'll have to share it here for anybody who comes across this thread in the future:
xmodmap -e "keycode 104 = Return"This can be put into your own startup script so that there is no need to mess with system files. The correct keycode can be found by looking at the output of xmodmap -pke or with the xev command.