Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App not recognize any keys except first "enter" and "ctrl + q" #4

Closed
qarmin opened this issue Jul 23, 2023 · 6 comments · Fixed by #9
Closed

App not recognize any keys except first "enter" and "ctrl + q" #4

qarmin opened this issue Jul 23, 2023 · 6 comments · Fixed by #9
Labels
bug Something isn't working rust

Comments

@qarmin
Copy link

qarmin commented Jul 23, 2023

System:
  Host: rafal-H87M-D3H Kernel: 6.2.0-25-generic arch: x86_64 bits: 64
    compiler: N/A Desktop: GNOME v: 44.2 Distro: Ubuntu 23.04 (Lunar Lobster)
Graphics:
  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
    vendor: Sapphire driver: amdgpu v: kernel arch: GCN-4 bus-ID: 01:00.0
    temp: 45.0 C
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.8 driver: X:
    loaded: amdgpu unloaded: fbdev,modesetting,radeon,vesa dri: radeonsi
    gpu: amdgpu resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
  API: OpenGL v: 4.6 Mesa 23.0.4 (git-896db04e02) renderer: AMD Radeon RX
    570 Series (polaris10 LLVM 15.0.7 DRM 3.49 6.2.0-25-generic)
    direct-render: Yes

app installed via cargo install

When clicking first time enter, screen freeze until I change size of terminal

Later no clicks are recognized except ctrl + q

simplescreenrecorder-2023-07-23_21.03.25.mp4
@johnblommers
Copy link

johnblommers commented Jul 23, 2023

I see the same behavior with gnome-terminal, mate-terminal, xterm and xfce4-terminal. It does work with Cool Retroterm.

Even after maximizing kbt to get it to display the keys it's not actually working, in that key presses don't appear.

My OS is PopOS 22.04 (based on Jammy) running GNOME desktop 42.5 and Xorg. Mesa is at 22.3.5, Vulkan is at 1.3.204.

I'm running Xorg and not Wayland.

I installed using cargo install kbt. My rustc is at 1.70.0.

@bloznelis
Copy link
Owner

I’m pretty sure it’s because you are running xwayland. We have a ticket to to explore if it’s possible to capture real (non terminal) keystrokes in wayland -> #3
@qarmin

@bloznelis
Copy link
Owner

bloznelis commented Jul 23, 2023

Ok, @johnblommers, ivalidated my previous claim. Will look into this as a bug then!

@bloznelis bloznelis added bug Something isn't working rust labels Jul 23, 2023
@bloznelis
Copy link
Owner

Sharing some findings.

These terminals, while in focus and keyboard is being clicked, do not produce X11 KeyPress and KeyReleased events which we use to detect key presses.

I found that xterm behaves non-deterministically. If moved around in window manager, sometimes starts emitting needed events. I suspect that it grabs input focus somehow, not sure yet.

A possible lead [from 12 years ago :0] -> https://stackoverflow.com/questions/8048653/keypress-events-for-x-windows

@bloznelis
Copy link
Owner

The 1.1.0 release tried to address this, for me it worked with all those terminals listed by you. Let me know if you have any additional issues.

@johnblommers
Copy link

johnblommers commented Jul 27, 2023

The 1.1.0 release tried to address this, for me it worked with all those terminals listed by you. Let me know if you have any additional issues.

Excellent kbt works with all of the terminals listed above: gnome-terminal, mate-terminal, xterm and xfce4-terminal. It still works with Cool Retroterm.

And ... it also works with Wezterm which is written in Rust :-)

kbt does want an X-Display to work. Therefore you cannot run it from a TTY session, for example CtrlAltF4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants