{"id":13392731,"url":"https://github.com/alols/xcape","last_synced_at":"2025-05-15T11:05:44.706Z","repository":{"id":2881776,"uuid":"3888265","full_name":"alols/xcape","owner":"alols","description":"Linux utility to configure modifier keys to act as other keys when pressed and released on their own.","archived":false,"fork":false,"pushed_at":"2022-09-13T06:49:04.000Z","size":84,"stargazers_count":2117,"open_issues_count":51,"forks_count":113,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-14T19:56:49.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alols.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}},"created_at":"2012-03-31T20:47:13.000Z","updated_at":"2025-03-21T19:52:30.000Z","dependencies_parsed_at":"2023-01-11T16:13:02.073Z","dependency_job_id":null,"html_url":"https://github.com/alols/xcape","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alols%2Fxcape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alols%2Fxcape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alols%2Fxcape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alols%2Fxcape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alols","download_url":"https://codeload.github.com/alols/xcape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"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":[],"created_at":"2024-07-30T17:00:36.215Z","updated_at":"2025-05-15T11:05:44.690Z","avatar_url":"https://github.com/alols.png","language":"C","funding_links":[],"categories":["C","Map CapsLock to Control","Installation","Software"],"sub_categories":["3. Query the database","Program list (note: may be outdated. See `setup.sh` for full dependency list)","Tools"],"readme":"XCAPE\n=====\n\nxcape allows you to use a modifier key as another key when pressed and\nreleased on its own. Note that it is slightly slower than pressing the\noriginal key, because the pressed event does not occur until the key is\nreleased. The default behaviour is to generate the Escape key when Left\nControl is pressed and released on its own. (If you don't understand why\nanybody would want this, I'm guessing that Vim is not your favourite text\neditor ;)\n\nMinimal building instructions\n-----------------------------\n\nFirst install the development dependencies. On Debian-based systems\n(including Ubuntu and Linux Mint), run:\n\n    $ sudo apt-get install git gcc make pkg-config libx11-dev libxtst-dev libxi-dev\n\nOn Fedora-based systems, run:\n\n    $ sudo dnf install git gcc make pkgconfig libX11-devel libXtst-devel libXi-devel\n\nThen run:\n\n    $ git clone https://github.com/alols/xcape.git\n    $ cd xcape\n    $ make\n    $ sudo make install\n\nUsage\n-----\n    $ xcape [-d] [-f] [-t \u003ctimeout ms\u003e] [-e \u003cmap-expression\u003e]\n\n### `-d`\n\nDebug mode. Does not fork into the background. Prints debug information.\n\n### `-f`\n\nForeground mode. Does not fork into the background.\n\n### `-t \u003ctimeout ms\u003e`\n\nIf you hold a key longer than this timeout, xcape will not generate a key\nevent. Default is 500 ms.\n\n### `-e \u003cmap-expression\u003e`\n\nThe expression has the grammar `'ModKey=Key[|OtherKey][;NextExpression]'`\n\nThe list of key names is found in the header file `X11/keysymdef.h` (remove\nthe `XK_` prefix). Note that due to limitations of X11 shifted keys *must*\nbe specified as a shift key followed by the key to be pressed rather than\nthe actual name of the character. For example to generate \"{\" the\nexpression `'ModKey=Shift_L|bracketleft'` could be used (assuming that you\nhave a key with \"{\" above \"[\").\n\nYou can also specify keys in decimal (prefix `#`), octal (`#0`), or\nhexadecimal (`#0x`). They will be interpreted as keycodes unless no corresponding\nkey name is found.\n\n#### Examples\n\n+   This will make Left Shift generate Escape when pressed and released on\n    its own, and Left Control generate Ctrl-O combination when pressed and\n    released on its own.\n\n        xcape -e 'Shift_L=Escape;Control_L=Control_L|O'\n\n+   In conjunction with xmodmap it is possible to make an ordinary key act\n    as an extra modifier. First map the key to the modifier with xmodmap\n    and then the modifier back to the key with xcape. However, this has\n    several limitations: the key will not work as ordinary until it is\n    released, and in particular, *it may act as a modifier unintentionally if\n    you type too fast.* This is not a bug in xcape, but an unavoidable\n    consequence of using these two tools together in this way.\n    As an example, we can make the space bar work as an additional ctrl\n    key when held (similar to\n    [Space2ctrl](https://github.com/r0adrunner/Space2Ctrl)) with the\n    following sequence of commands.\n\n        # Map an unused modifier's keysym to the spacebar's keycode and make it a\n        # control modifier. It needs to be an existing key so that emacs won't\n        # spazz out when you press it. Hyper_L is a good candidate.\n        spare_modifier=\"Hyper_L\"\n        xmodmap -e \"keycode 65 = $spare_modifier\"\n        xmodmap -e \"remove mod4 = $spare_modifier\" # hyper_l is mod4 by default\n        xmodmap -e \"add Control = $spare_modifier\"\n\n        # Map space to an unused keycode (to keep it around for xcape to\n        # use).\n        xmodmap -e \"keycode any = space\"\n\n        # Finally use xcape to cause the space bar to generate a space when tapped.\n        xcape -e \"$spare_modifier=space\"\n\n\nNote regarding xmodmap\n----------------------\n\nIf you are in the habit of remapping keycodes to keysyms (eg, using xmodmap),\nthere are two issues you may encounter.\n\n1. You will need to restart xcape after every time you modify the mapping from\n   keycodes to keysyms (eg, with xmodmap), or xcape will still use the old\n   mapping.\n\n2. The key you wish to send must have a defined keycode. So for example, with\n   the default mapping `Control_L=Escape`, you still need an escape key defined\n   in your xmodmap mapping. (I get around this by using 255, which my keyboard\n   cannot send).\n\nContact\n-------\n\nFind the latest version at\nhttps://github.com/alols/xcape\n\nThe author can be reached at\nalbin dot olsson at gmail dot com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falols%2Fxcape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falols%2Fxcape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falols%2Fxcape/lists"}