emilk / emilk/egui

key_pressed is detected when it was only a release

Open
#2,250 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Describe the bug**
I start the app from terminal, so I press an enter to run the command. The app is fast and it is loading quickly, and the enter key at this time is pressed down, despite this, X.org will not send a key_down event to the window since that is processed by the terminal emulator. The only event the window should get is a key_release. You can test it by running `xev`, where you will see a key_release event only for the Return keysym.

**To Reproduce**
Steps to reproduce the behavior:
1. Clone this repo https://github.com/fxdave/vonal-rust/tree/input-test
2. Start the daemon by: cargo run --release --bin vonal
3. Run the client by: cargo run --release --bin vonalc show
4. See the daemon's logs, and you will see 'pressed'.

**Example log**
```
...
requesting redraw because of window event
requesting redraw because of window event
requesting redraw because of window event
update called
pressed
update called
update called
requesting redraw because of window event
update called
released
update called
update called
...
```

**Expected behavior**
When the window opens I would expect only a key_release event, instead of key_pressed then key_release.

**Desktop:**
- OS: Arch linux

**Additional context**
I use egui-glow. Maybe that's the problematic part.

Contributor guide

Open the contributing guide

Research direction

Reproduce the report using the linked vonal-rust input-test branch and the two cargo run commands, then compare the daemon logs with xev's Return key events. Trace the egui-glow window-event path to determine why a key press is reported before the release; done means the startup sequence reports only the key release.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.