{"id":26508871,"url":"https://github.com/adamkdean/remap-k120","last_synced_at":"2025-03-21T00:38:21.677Z","repository":{"id":152285955,"uuid":"414578431","full_name":"adamkdean/remap-k120","owner":"adamkdean","description":"MacOS remapping for Logitech K120","archived":false,"fork":false,"pushed_at":"2024-04-03T22:34:56.000Z","size":583,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-06T18:43:03.300Z","etag":null,"topics":["k120","keyboard","logitech","remapping-keyboards"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamkdean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-10-07T11:45:36.000Z","updated_at":"2021-10-07T17:24:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9de2fa1-2206-4c96-95ae-2919b1326445","html_url":"https://github.com/adamkdean/remap-k120","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/adamkdean%2Fremap-k120","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkdean%2Fremap-k120/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkdean%2Fremap-k120/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamkdean%2Fremap-k120/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamkdean","download_url":"https://codeload.github.com/adamkdean/remap-k120/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244717364,"owners_count":20498284,"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":["k120","keyboard","logitech","remapping-keyboards"],"created_at":"2025-03-21T00:38:21.108Z","updated_at":"2025-03-21T00:38:21.662Z","avatar_url":"https://github.com/adamkdean.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keymap-k120\n\nI have long used Logitech K120 keyboards for non-Mac workstations, but since I moved from using a MacBook everyday to using an iMac Pro every day, I've struggled to find a keyboard that matches the K120. It's not particularly special, but it's comfortable, cheap, easily replacable, and quiet. Unfortunately, it doesn't work very well with MacOS, especially not out of the box.\n\nWith help from friends near and far, and all their previous work, I've been able to finally solve my keyboard misery.\n\n## Remapped keys\n\n`remap-k120` swaps the left and right windows \u0026 alt keys to option \u0026 command keys, along with swapping F9 onwards. I place this file in `/home/adam/bin/remap-k120`.\n\n`F9` becomes previous track, `F10` becomes next track.\n\n `F11` becomes volume down, and `F12` becomes volume up.\n\n`Print Screen` becomes play/pause.\n\n`Scroll Lock` becomes brightness down, and `Pause` becomes brightness up.\n\nI struggled to find the keycodes for these until I found this [fantastic resource](https://www.maven.de/2018/05/more_keyboards/).\n\n## xpc_set_event_stream_handler\n\nThe `xpc_set_event_stream_handler` consumes events from MacOS. I'm told this is very important.\n\nTo compile this, navigate to the directory containing `main.m` and run `clang -framework Foundation main.m -o bin`.\n\nI then move this to `/usr/local/bin/xpc_set_event_stream_handler`.\n\n## LaunchDaemon\n\nI place the `com.adamkdean.remap-k120.plist` file in `/Library/LaunchDaemons`.\n\nIf you use this, be sure to update paths within this file:\n\n```xml\n\u003ckey\u003eProgramArguments\u003c/key\u003e\n\t\u003carray\u003e\n\t\t\u003cstring\u003e/usr/local/bin/xpc_set_event_stream_handler\u003c/string\u003e\n\t\t\u003cstring\u003e/Users/adam/bin/remap-k120\u003c/string\u003e\n\t\t\u003cstring\u003e/bin/bash -c \"sleep 5\"\u003c/string\u003e\n\t\u003c/array\u003e\n  ...\n```\n\n## Resetting\n\nYou can easily reset the mappings using the `default-mapping` file provided by Martin.\n\n## Physical alterations\n\nIn order to make my life a little better, I used a label maker to adjust the keyboard slightly.\n\n![preview](image.jpg)\n\n## Thanks to\n\n- [Martin Thorpe](https://twitter.com/met24fly) without whom I'd have been totally lost\n- [Ford Parsons](https://github.com/snosrap) for his work on xpc_set_event_stream_handler\n- [Daniel Vollmer](https://www.maven.de/2018/05/more_keyboards/) whose work allowed me to solve the media key issue\n\n## Resources\n\n- https://github.com/snosrap/xpc_set_event_stream_handler\n- https://developer.apple.com/library/archive/technotes/tn2450/_index.html\n- https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf (page53)\n- https://developer.apple.com/documentation/uikit/uikeyboardhidusage\n- https://eastmanreference.com/complete-list-of-applescript-key-codes\n- https://www.usb.org/sites/default/files/hut1_21_0.pdf#page=118\n- https://qa.emptyq.net/q?id=c95a5415-82f8-45cc-98c4-c97f869891f1\n- https://www.maven.de/2018/05/more_keyboards/\n\n# Keywords\n\nTo help people find this, here are some keywords and associated searches:\n\n- How to use Logitech K120 windows keyboard on Mac?\n- Is Logitech K120 compatible with a Mac?\n- Logitech K120 Mac\n- Can I use Logitech K120 with Mac?\n- Logitech K120\n- Mac, MacOS, OSX\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkdean%2Fremap-k120","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamkdean%2Fremap-k120","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamkdean%2Fremap-k120/lists"}