spacefn-evdev icon indicating copy to clipboard operation
spacefn-evdev copied to clipboard

After starting repeated return code is send

Open ijskegel opened this issue 6 years ago • 5 comments

After starting spacefn-evdev return code is send repeatedly. This is on Debian 10.

I start the application with: sudo ./spacefn /dev/input/......

And get the following output: state 0 and after that a lot of empty lines (carriage returns) that keeps continuing.

After pressing the space bar once everything is fine.

If I start spacefn in the background and redirect all output to /dev/null the same happens.

BTW: Thanks for this amazing tool that makes using space-fn on a laptop keyboard possible!

ijskegel avatar Dec 10 '19 08:12 ijskegel

This happens because it grabs the input device, which stops the Return key-release code from being picked up by X11. I wonder, is the bug that the key-release is passed through by spacefn and ignored by X, or that the key-release is not passed through? Can you work it out?

abrasive avatar Dec 10 '19 08:12 abrasive

Ok, that makes sense. I'm not very familiar with key presses and release in linux. Can you give me a hint on how I can work out what the actual problem is?

I've added a print statement to the read_one_key function: fprintf(stdout, "type:%d, code:%d, value:%d\n", ev->type, ev->code, ev->value); fflush(stdout);

Now it shows the following after starting spacefn:

state 0
type:4, code:4, value:28
type:1, code:28, value:0
type:0, code:0, value:0
<newline>
<newline>
<newline>
<newline>
...

If I hit the space bar then it shows:

type:4, code:4, value:57
type:1, code:57, value:1
state 1

ijskegel avatar Dec 10 '19 08:12 ijskegel

I observe the same behavior on Ubuntu 19.10.

maciejmotyka avatar Dec 10 '19 13:12 maciejmotyka

I also have it with Linux Mint. Somehow the input device sends Enter-press without Enter-release.

hoanglongcao avatar May 11 '20 19:05 hoanglongcao

I can confirm the issue on Ubuntu 20.04.

TimApplepie avatar Jul 15 '20 15:07 TimApplepie