{"id":16400980,"url":"https://github.com/moertel/keycount","last_synced_at":"2025-02-23T14:18:20.489Z","repository":{"id":102337099,"uuid":"216912256","full_name":"moertel/keycount","owner":"moertel","description":"Count keystrokes and increase a counter in a text file (for e.g. an Undo counter in Twitch)","archived":false,"fork":false,"pushed_at":"2019-10-22T21:49:15.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-05T02:26:56.226Z","etag":null,"topics":["counter","keylogger","twitch","undo"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moertel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-22T21:24:05.000Z","updated_at":"2019-10-22T21:49:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab8856a9-1c98-42ee-adff-17f673a1cf93","html_url":"https://github.com/moertel/keycount","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moertel%2Fkeycount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moertel%2Fkeycount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moertel%2Fkeycount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moertel%2Fkeycount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moertel","download_url":"https://codeload.github.com/moertel/keycount/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324070,"owners_count":19783455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["counter","keylogger","twitch","undo"],"created_at":"2024-10-11T05:29:08.195Z","updated_at":"2025-02-23T14:18:20.205Z","avatar_url":"https://github.com/moertel.png","language":"Python","readme":"KeyCount\n========\n\nThis script monitors keyboard input and increases a counter in a textfile whenever a specific key (or combination of keys) is pressed. The primary use case is an Undo counter for Twitch streams.\n\n\n## Installation\n\nYou need a working Python 3 installation on your system. Then...\n\n1. Checkout this repository\n2. Open your Terminal and navigate to the repository's location\n3. Install the dependencies:\n```\npip install -r requirements.txt\n```\n\n## Usage\n\nTo get the count of \"Undo\" (`[Cmd]+[Z]`) in a text file `counter.txt`, run this in your Terminal:\n```bash\nKEYCOUNT_SEQUENCE='Key.cmd,z' python keycount.py\n```\nIn case you don't know the exact names of the keys you want to monitor, you can enable debug logging, so pressing keys will be echoed to the Terminal:\n```\nKEYCOUNT_LEVEL=DEBUG python keycount.py\n```\nTo stop the script, press `[Ctrl]+[c]` in the Terminal.\n\n### Customisation\n\n| Environment variable | Description |\n| -------------------- | ----------- |\n| `KEYCOUNT_LEVEL` | Level at which logs should be emitted. DEBUG will emit all keystrokes, INFO is the default. |\n| `KEYCOUNT_FILENAME` | Name of the file where to store the counter |\n| `KEYCOUNT_SEQUENCE` | Key or sequence of keys to monitor, delimited by `,` |\n| `KEYCOUNT_DELIMITER` | Ok, so you want to monitor the `,` key being pressed? Then this value lets you customise the delimiter used in the `KEYCOUNT_SEQUENCE` |\n\n## Known Issues\n\nHere's a list of things that I can imagine could cause issues for you. They didn't play a role for my use case so I didn't bother implementing/fixing them but contributions are always welcome. :)\n\n * The script doesn't really monitor combinations, so if you press `[Cmd]`, release the key, and then press `[z]`, it would count as an undo although ideally you'd have to press both keys simultaneously.\n * On some systems, special keys such as `[Cmd]` appear not as `Key.cmd` but `Key.cmd_l` or `Key.cmd_r` depending on whether the left or right key is pressed on the keyboard. As there's no way to provide multiple sequences to a single script, some combinations pressed might go unnoticed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoertel%2Fkeycount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoertel%2Fkeycount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoertel%2Fkeycount/lists"}