News for hackers. Stuff that matters.
Re:Why Is It So Hard to Detect Keyup Events on Linux? by nerdponx on Sunday January 27, 2019 @11:55AM (#19012494)
This weirdly seems like the "right" implementation to me. Somehow I feel like a TTY generally doesn't need or deserve to know when keys are pressed and released.

That said, is there a more end-to-end summary out there of how keyboard input is handled in GNU/Linux? I have the vague understanding that USB HID scancodes are translated into keycodes, which are sent along to X applications or a TTY, but where and how each step happens is still a bit mysterious to me.

Re:Why Is It So Hard to Detect Keyup Events on Linux? by amelius on Sunday January 27, 2019 @12:51PM (#19012791)
> Somehow I feel like a TTY generally doesn't need or deserve to know when keys are pressed and released.

Why? What if I'm playing a game on that TTY?

Re:Why Is It So Hard to Detect Keyup Events on Linux? by darkpuma on Sunday January 27, 2019 @06:04PM (#19014307)
Games are the reason we have X or Wayland.

Yes you can play games in terminals. Years back I used to be pretty enthusiastic about roguelike development (rec.games.roguelike.development) Those games are almost universally designed in a way that doesn't require key-up info. Where you really need key-up info is in realtime games like tetris, except in practice even for tetris you can do just fine without key-up. Now, if you were playing Quake using a aalib renderer, then you'd definitely want key-up to stay competitive. But then you've also got the problem of sending stereo sound over ssh! Should terminal emulators be made to support that too?

There are lots of terminal games. There are lots of realtime games. The demand for games that are both at the same time is pretty damn niche. And when you plausibly find yourself in that niche, you realize that needing key up info is the least of your problems. This is indicative of using the wrong tool for the job.

Trying to play quake in your terminal emulator with responsive controls is like trying to take your car out into the bay to do some fishing so you go at it with a caulk gun and expanding foam, slap a sail on top, only to realize you don't have a keel to the wind flips you right over. Just get a boat.

Re:Why Is It So Hard to Detect Keyup Events on Linux? by cryptonector on Sunday January 27, 2019 @12:57PM (#19012819)
Mainly because there exists no protocol by which the terminal (really, terminal emulator) can indicate these events, and the tty/pty drivers don't know how to decode that non-existent protocol to spare existing apps having to be modified to understand it.

This all goes back to the 70s, when people first hooked up typewriters to computers as terminals: everything was far too simple to make it possible to add such a protocol, and nobody cared about key up events, and they weren't going to care for a long time because the hardware and software all had to be rather simple (exceedingly so by our standards today).

Re:Why Is It So Hard to Detect Keyup Events on Linux? by Dylan16807 on Sunday January 27, 2019 @01:35PM (#19013030)
You made a nice post but that's not the question being asked. The historical record is different from the question of whether a terminal needs/deserves it this decade. ("need" obviously being non-literal)
Re:Why Is It So Hard to Detect Keyup Events on Linux? by cryptonector on Sunday January 27, 2019 @01:45PM (#19013080)
The submission's title is "Why Is It So Hard to Detect Keyup Event on Linux?". I knew the answer to that very specific question, so I offered it :)

As to whether we need to evolve this functionality today, I would hazard that the answer is "no". I did sketch out how it would be done, if we really need it and people want to implement it. But my guess is that there are too few people with the desire and funding to work on this problem. Reading TFA today is the first time I've ever heard of anyone wanting key up events in the tty -a tty that has some 45+ years of history- so I'm a bit skeptical that this will somehow become such a blindingly obviously highly desirable feature _now_ that it might get done.

Re:Why Is It So Hard to Detect Keyup Events on Linux? by Dylan16807 on Sunday January 27, 2019 @01:59PM (#19013154)
> The submission's title is "Why Is It So Hard to Detect Keyup Event on Linux?". I knew the answer to that very specific question, so I offered it :)

You didn't reply to the top level article, you replied to a specific comment, which was asking a different question.

And "not enough desire to make the change now that we're so entrenched" is still different from "does it deserve to know, if we were doing it right". And I would say the latter is true. (Still ignoring "need" because "need" is really vague.)

Re:Why Is It So Hard to Detect Keyup Events on Linux? by cryptonector on Sunday January 27, 2019 @02:00PM (#19013164)
Fair enough. That post said:

> Why? What if I'm playing a game on that TTY?

So my answer was still on point.

Re:Why Is It So Hard to Detect Keyup Events on Linux? by Dylan16807 on Sunday January 27, 2019 @02:03PM (#19013179)
The predicate to that specific "Why" was "doesn't need or deserve to know", not "is so hard to detect on linux".