Comments (3)
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 Line 145 to Line 256 has the mappings of the keyboard keys(QWERTY) corresponding to the keycode(produced in CallBackFunction.swift file From Line 133 to Line 162 ).
from swift-keylogger.
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
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:
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.
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)
- Can't open HID! on Sierra HOT 2
- Is there a way to log the passwords? HOT 8
- Convert > To Current Swift Syntax
- I made a UI interface for "Keylogger", but it didn't work ... HOT 2
- CPM counter HOT 7
- Possibility to temporary enable/disable password log? HOT 4
- Can't open HID! HOT 3
- Incorrect app detected when using multiple screens
- Azerty Version ? HOT 4
- [Question] May I ask why you went with HID API and not CGEventTap API? HOT 1
- Is it possible to add [CMD+(KEY)]
- Key's not getting logged when using Karabiner on mac HOT 3
- Keyboard events are going to have cut off after several hours. HOT 3
- Compress and delete the old logs automatically HOT 1
- Donation? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-keylogger.