7 ms·
Yes I once spent a whole day debugging an issue related to this because I was unaware of it. I was getting a game Steam ready and I was working on the Steam ove
by dangero 9y ago
Yes I once spent a whole day debugging an issue related to this because I was unaware of it. I was getting a game Steam ready and I was working on the Steam overlay that is triggered by the tab key.
QA reported that on the login screen, you sometimes had to press tab twice to get the overlay to open. Just on that one screen.
I had a piece of code that was looking for the tab keydown event to open the overlay, but in some cases the event was not being triggered. Turned out that the browser password field used EnableSecureEventInput and so the if the cursor focus was in the password input box, the tab button press would not be detected by my code. Pressing it twice worked because:
-first tab press moved cursor focus out of the password box
-second tab press was in the username input field which was not a secure input field, so my code received the tab keydown event.
The weird part about this is since the tab keydown moves the cursor focus out of the secure text box what you receive is a tab keyup event with no keydown before it.
- passivepinetree 9y agoInteresting anecdote. What did you end up doing? Did you just leave it as-was?
- jwandborg 9y agoS?he probably listened to the keyup event instead.
- Void_ 9y agoHis name is Dan ...
- deleted 9y ago[deleted]
- novium 9y agoStill not a reason to assume things here.
- kupiakos 9y agoShould just default to the singular they then.
- jwandborg 9y agoMy fault. I'm more comfortable with regular expressions than the English language.
- eradicatethots 9y agoIs it just me or is none of this a big deal?
- Moter8 9y agoPeople don't first go to the user profile to look for a name. dangero seems like a random nick
- zbentley 9y agodangero . . . us?
- dan1234 9y agoDan could be short for Danielle or Danika or…
- jen729w 9y agoPeople always assume I’m “Jen”, female, which is often enlightening. They’re my initials.
- jwandborg 9y ago- I did not read their username. - I did not click through to their profile. The cause for both of these is that my mobile HN experience is horrible for me (a lazy person). I spent a few seconds looking for a word to replace "She/He", when none came to mind I fell back to a regular expression[1]. As iaml pointed out[2] (along with others) https://en.wikipedia.org/wiki/Singular_they https://en.wikipedia.org/wiki/Singular_they is the proper solution to this issue, and I will try to remember that in the future. --- [1] as we so often do in our daily lives. [2] https://news.ycombinator.com/item?id=15489652 https://news.ycombinator.com/item?id=15489652 --- In my second attempt at comedy today, Trying to perform the error-prone art of interpreting genders based on usernames, the best I came up with for you is /^\0_$/ Feedback welcome, this is my first attempt at matching null in a regular expression. I'll explain the joke, so that no-one feels left out: I interpret name "Void" as gender "null", then carry the underscore over, using artistic license, to make the regex more interesting.
- Legogris 9y agoYou'd have to listen to both, right? Otherwise it'd be the same issue when the user tabs into the password input rather than out of.
- thomastjeffery 9y agoNo. You could listen for the keydown, but you wouldn't hear it, so you may as well ignore what you can't hear.
- michaelmior 9y agoYou should get a key down event when moving into the password field since you're coming from a field which is not secure.
- dangero 9y agoYes you're right. I made a variable that tracked the current state of keyup keydown and could detect this special case.
- iaml 9y agohttps://en.wikipedia.org/wiki/Singular_they https://en.wikipedia.org/wiki/Singular_they
- jwandborg 9y agoThank you, that is much better than /S?he|\w+kin|.*/ This irrational regular expression is an attempt at comedy. On a serious note, I was looking for that word, but failed to remember it[0]. [0] https://news.ycombinator.com/item?id=15490542 https://news.ycombinator.com/item?id=15490542
- Iv 9y agoI guess he looked for key-up events.
- dangero 9y agoYes, you could detect the condition by tracking key-up events without matching keydown events, so I wrote a little logic that would keep track of tab keyup-keydown states and with that I could detect it.