Git Product home page Git Product logo

Comments (3)

SkrewEverything avatar SkrewEverything commented on June 5, 2024 1

In CallBackFunction.swift file:

  • From Line 109 to Line 132 deals with the fileName(current active/focused app) and writes the timestamp to that particular app named file

  • From Line 133 to Line 162 deals with which key has been pressed and writes that keypress to the file.

In Keylogger.swift file:

from swift-keylogger.

SkrewEverything avatar SkrewEverything commented on June 5, 2024

Hi @achalagarwal

I have 2 reasons for not implementing this behaviour.

Reason: 1

I thought of doing it initially but after some googling, I realised it is based on OS behaviour.

On low-level, the system only detects whether a key is pressed or released.

macOS decides what to do based on the settings in Settings.app
Screenshot 2020-11-22 at 6 51 02 PM

This functionality can be done by getting settings data and using timers and if statements.

But, long-pressing a key displays a popup to select accented characters like this:

image

The accented characters can either be selected by pressing the corresponding number or clicking on the character directly, which can't be detected accurately.

Again, this behaviour can be disabled but only through the terminal like this. But some users prefer getting this popup.

defaults write -g ApplePressAndHoldEnabled -bool false

Implementing all these(timers, preferences etc) would have become too complex for others to extend the functionality based on their needs and also, there is a lot of probability for false positives. So, I decided not to include the functionality.


Reason 2:

Another reason is, as far as I have seen, no one presses the key to type repeated characters, which are meaningful. We only long-press the key when we want to spam a certain character without a proper meaning or to move the cursor or modifier keys. None of them makes sense to log multiple times.

So, making the keylogger's implementation complex just for a very small percentage of users(maybe you might have a proper use-case) seemed completely unnecessary for me.

from swift-keylogger.

achalagarwal avatar achalagarwal commented on June 5, 2024

Thanks @SkrewEverything

Your points are justified. I would like to modify your implementation to get the key release and key pressed signals.

Do you have an entry function in mind, from where I could start tinkering/digging?

from swift-keylogger.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.