319 points · by saranshk · 6y ago · 127 comments
// I just cleaned up the code. I have no idea what this fn does. Here is
// what the comment said earlier for your reference!
// --> BUG!! - this code is a crime against nature and has absolutely no
// --> redeeming value (other than the amazing fact that it works)Focus handling is generally terrible in web apps, but few instances infuriate me like this one.
So it starts to intersect with some non-obvious accessibility issues.
Roughly equivalent: why do people shop at Whole Foods when they can get the same food cheaper at a farmer’s market? The produce is washed, curated for imperfections, and marked up.
These streaming platforms are not perfect as no product since Unix has been, but to think altruistic programmers working for free can do an equivalent job is hubris. These interfaces take years of iteration and optimization in subtle ways like Netflix A/B testing thousands of generated cover photos.
Doesn't at all discount your point, just wanted to help out anyone who's still using WinAmp because of the skins (I was up to last year).
Your browser might try to pop you down half a page if the thing that is selected or highlighted on the page is not the video player itself though. But it works 100% of the time in fullscreen.
Usefully, the up/down keys don't change the volume unless the player is also focused.
What's incredibly sad is that j/k/l were agreed upon to rewind/pause/forward the video, and these generally work unless you're in a textbox... but dedicated keys were not similarly approved to control the volume.
--
My current winner for Absolutely Favorite Piece Of YouTube-Related Keyboard Functionality©®℠ is...
YouTube Music (https://music.youtube.com/)... which uses a different set of fundamental keyboard shortcuts to YouTube. [;]=pause, [j]=next, [k]=prev, [l]=forward, [h]=rewind.
There are two disasters here.
The first is that <YouTube/pause> == <YouTube Music/rewind to beginning>. "Nooooo! I was 2 hours?? and how many seconds??? into this video... >.<". Naturally, in this situation, I ReWoUnD ThE ViDeO To ThE BeGiNnInG MySeLf, so YouTube's "last play position" indicator can't help me here. YAYYY.
The second disaster is that it's obvious a Vim user clearly argued successfully for Music to use Vi-style hjkl, but both the key choices and how they are presented in the UI could not be less intuitive, regardless of whether the user also uses Vim or not.
I copied above exactly how the UI (in the [?] popup) lists the sequence. Specifically, the whole thing is shifted left by 1 position, wrapping [h] around to the right. Fixing that to show the sequence how a Vim user would expect, it looks like: [h]=rewind, [j]=next, [k]=prev, [l]=forward.
But then, any Vim user is going to be utterly confused by this sequence, not only because of the mild readjustment of assigning up/down to prev/next and left/right to seeking - but because Vim "up" [j] is assigned to "next", and Vim "down" [k] is assigned to "prev".
Upside down playlist much?!?!
I no longer use YouTube Music, solely because of the number of long videos I have rewound and lost my position in.
I'm also incidentally trying to passively commit hjkl to memory (you know, the whole spaced repetition thing), and all the above was just too confusing.
I like the context sensitive behavior and wrote a grease mo key script to restore it.
https://stackoverflow.com/questions/184618/what-is-the-best-...
I have other issues with SO but having a USP and sticking with it isn't their problem, IMHO.
Sometimes, we just need someone to help translate our needs into a different wording and everything clicks into place. I'm sure that this causes a lot of repeated questions, but that's why when someone links a relevant question, it might be enough to solve the issue.
Throwing some serious vocab shade in these comments, love it.
To me, pulchritude is such an ugly sounding word I can always remember the meaning as being the opposite of how it sounds.
(Funny enough, I was just looking up to see if there is a name for words that sound opposite to their meaning and found this [0] discussion on the English stack exchange, which gives pulchritude as its example!)
[0] https://english.stackexchange.com/questions/103741/name-for-...
A guy with an unshaven face, wild hair, casual or wrinkled clothes, etc would never be described as "pulcro", even if they otherwise look very handsome, beautiful, or attractive.
* https://www.dl.cambridgescp.com/dl_course/book-i
A random other example: https://www.ocr.org.uk/Images/221512-gcse-latin-j282-defined...
It is blessed officially as doing a "dirty" assign.
If there's no API exposing them but there's a way to make use of the internals with a dirty assign then sounds like the internals are now part of the API.
It's a fucking mess, but boy do they print money.
I eventually traced it to one specific line of original founder code, and lo and behold, on that line was the comment: "this is probably buggy".
Why?
I like how keyup is less ambiguous: it avoids the question “what do I do if the user is holding the key down?”
I also like being able to hold the key down to cue up a command and then at the right time, pull my hand away to execute crisply. For video editing mainly.
I’m not saying keyup is the only answer. Just that there isn’t one obvious answer.
Because of the reported bug in this example (which I also encountered quite often):
- user hits ESCAPE
- my window gets key-down/ESCAPE and closes itself
- your window (which happens to be the next in the focus-order) gets key-up/ESCAPE and closes itself
> I also like being able to hold the key down to cue up a command and then at the right time, pull my hand away to execute crisply
Ok, but if your window wants to support this behavior (which is not very common) you have to watch for key-up AND key-down like the bug-report suggests.
Not saying key down is better than key up, there are certainly arguments for both.
[0]: https://www.eejournal.com/article/ultimate-guide-to-switch-d...
Should they, in general? If you want to press a key combination, you never press the two keys at exactly the same time. So, if key events were on key-down, you would have to press modifiers before letters to type capital letters, use keyboard shortcuts, etc. I think that would be annoying and slow typists down.
It also rules out using bare modifier key presses as input methods, but that is less of an impact.
Do people who want a capital 'A' ever intentionally type A-Shift instead of Shift-A? I've never heard of it before.
xscreensaver also comes to mind; Jamie likes to keep all the legacy crap in the source code for operating systems and X extensions long gone, including rants about how they're broken under certain conditions, even if the bug is long fixed, just in case someone wants to compile the current version on their 1996 HPUX workstation.
But it's never xscreensaver, of course.
> If you add some obscure code such as below, to this or any other app, even if it has only the teeniest chance of being less blindingly obvious to someone else than it is to you at the time of writing, please please please add a fing comment.
This rings as true now as it did then and its my favorite comment so far out of this whole leak. I've reached a point where my comments are there to remind myself why I did a thing, because more often than not I'm the poor bastard who's stuck fixing what past me did, and past me was either a sadistic asshole or a blithering idiot.
Since the 2002 TWC initiative, anything from easter eggs to things like that are all very strongly banned, and actively get removed as they're discovered.
But a bit of googling shows it was part of TWC: https://docs.microsoft.com/en-us/archive/blogs/larryosterman...
In this context it refers to the early 2000s memo/paradigm shift at Microsoft as well as the now-defunct centralized infosec group.