News for hackers. Stuff that matters.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by dangero on Tuesday October 17, 2017 @01:55AM (#15488964)
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.

Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by passivepinetree on Tuesday October 17, 2017 @02:48AM (#15489128)
Interesting anecdote. What did you end up doing? Did you just leave it as-was?
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by Iv on Tuesday October 17, 2017 @03:58AM (#15489321)
I guess he looked for key-up events.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by dangero on Tuesday October 17, 2017 @02:00PM (#15493117)
Yes, 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.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by jwandborg on Tuesday October 17, 2017 @03:37AM (#15489263)
S?he probably listened to the keyup event instead.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by iaml on Tuesday October 17, 2017 @05:30AM (#15489652)
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by jwandborg on Tuesday October 17, 2017 @09:11AM (#15490592)
Thank 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

Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by Legogris on Tuesday October 17, 2017 @04:28AM (#15489434)
You'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.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by thomastjeffery on Tuesday October 17, 2017 @05:32AM (#15489660)
No.

You could listen for the keydown, but you wouldn't hear it, so you may as well ignore what you can't hear.

Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by michaelmior on Tuesday October 17, 2017 @06:39AM (#15489902)
You should get a key down event when moving into the password field since you're coming from a field which is not secure.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by dangero on Tuesday October 17, 2017 @02:02PM (#15493138)
Yes you're right. I made a variable that tracked the current state of keyup keydown and could detect this special case.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by Void_ on Tuesday October 17, 2017 @03:57AM (#15489319)
His name is Dan ...
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by jwandborg on Tuesday October 17, 2017 @09:04AM (#15490542)
- 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 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

---

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.

Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by Moter8 on Tuesday October 17, 2017 @04:25AM (#15489423)
People don't first go to the user profile to look for a name. dangero seems like a random nick
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by zbentley on Tuesday October 17, 2017 @08:21AM (#15490308)
dangero . . . us?
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by dan1234 on Tuesday October 17, 2017 @05:14AM (#15489600)
Dan could be short for Danielle or Danika or…
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by jen729w on Tuesday October 17, 2017 @07:09AM (#15490018)
People always assume I’m “Jen”, female, which is often enlightening. They’re my initials.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by novium on Tuesday October 17, 2017 @04:07AM (#15489357)
Still not a reason to assume things here.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by kupiakos on Tuesday October 17, 2017 @04:44AM (#15489492)
Should just default to the singular they then.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by jwandborg on Tuesday October 17, 2017 @09:06AM (#15490557)
My fault. I'm more comfortable with regular expressions than the English language.
Re:Swift-Keylogger – Keylogger for MacOS written in Swift us... by eradicatethots on Tuesday October 17, 2017 @09:40AM (#15490777)
Is it just me or is none of this a big deal?