You are not logged in.

#1 2021-07-08 13:27:28

opens
Member
Registered: 2019-08-08
Posts: 25

[Solved] Sway - Return key does not work

Hi all,

I am using Sway (Arch Linux) in the VirtualBox on MacOs.

However, the return key does not work in Sway, it does work in tty.
The mod-key works fine.

Also on the external keyboard the return key does not work.

Do you have any suggestions how to troubleshoot?

Thank you very much!

Last edited by opens (2021-07-09 15:24:48)

Offline

#2 2021-07-08 17:25:20

natervance
Member
Registered: 2017-04-20
Posts: 53

Re: [Solved] Sway - Return key does not work

I'd start by making sure that it's sending the correct keycode using the evtest command. For me things look somewhat like the following:

$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:	Power Button
/dev/input/event1:	Power Button
/dev/input/event2:	Dell Dell USB Keyboard
/dev/input/event3:	Logitech USB Optical Mouse
...
Select the device event number [0-16]: 2
...
Event code 28 (KEY_ENTER)
...
# And then, every time I press and release the enter key:
Event: time 1625764442.330981, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
Event: time 1625764442.330981, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1
Event: time 1625764442.330981, -------------- SYN_REPORT ------------

Event: time 1625764442.394989, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70028
Event: time 1625764442.394989, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1625764442.330981, -------------- SYN_REPORT ------------

Many lines omitted for brevity, but you get the idea. If virtualbox is reinterpreting the enter key as something else, then you'll probably see something other than key code 28 when you hit enter. Now, as to how you can get sway to pop up a terminal with evtest running and without the use of the enter key, I'd do the following. Edit your sway config to include the following shortcut:

bindsym $mod+t exec xterm -e "sudo evtest /dev/input/event2"

This launches xterm with evtest operating on input event2. Of course, make sure you have xterm installed, you'll need passwordless sudo (at least temporarily to do this test), and you'll have to verify that your keyboard is event2 or modify the command accordingly.

Anyhow, that's how I'd go about troubleshooting.

Offline

#3 2021-07-09 14:07:49

opens
Member
Registered: 2019-08-08
Posts: 25

Re: [Solved] Sway - Return key does not work

Thank you. It seems that alacritty showed an error, but now it works.
Why do I actually need xorg-wayland for launching dmenu? Without it, it did not work.

Thank you!

Offline

#4 2021-07-09 14:16:26

natervance
Member
Registered: 2017-04-20
Posts: 53

Re: [Solved] Sway - Return key does not work

Glad it's working! You need xorg-wayland for dmenu because dmenu is an older X11-centric software. It looks like sway-launcher-desktop tries to be the modern launcher for sway (and doesn't depend on xorg-wayland), but it isn't the default yet. If you're trying for an X11-free desktop, maybe give that launcher a whirl.

Offline

#5 2021-07-09 15:24:59

opens
Member
Registered: 2019-08-08
Posts: 25

Re: [Solved] Sway - Return key does not work

Thanks a lot!

Offline

#6 2021-07-09 15:46:45

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [Solved] Sway - Return key does not work

natervance wrote:

Glad it's working! You need xorg-wayland for dmenu because dmenu is an older X11-centric software. It looks like sway-launcher-desktop tries to be the modern launcher for sway (and doesn't depend on xorg-wayland), but it isn't the default yet. If you're trying for an X11-free desktop, maybe give that launcher a whirl.

There are also other options like bemenu (a dmenu alternative): https://wiki.archlinux.org/title/Sway#A … _launchers
and https://github.com/swaywm/sway/wiki/Use … s-for-sway

Last edited by progandy (2021-07-09 15:47:35)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB