[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116651":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":37,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":15,"starSnapshotCount":15,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},116651,"margin","arxhr007\u002Fmargin","arxhr007","Turn the edges and corners of your touchpad into volume, brightness, seek, Alt+Tab and custom shortcut controls. A tiny native Rust app for Windows and Linux, no runtime, no telemetry.","https:\u002F\u002Farxhr007.github.io\u002Fmargin\u002F",null,"Rust",56,3,51,0,1,5,6,46.81,"MIT License",false,"main",true,[25,26,27,28,29,30,31,32,33,34,35,36],"brightness-control","evdev","gestures","linux","precision-touchpad","productivity","rust","system-tray","touchpad","volume-control","win32","windows","2026-11-19 09:38:27","2026-11-23 03:38:07","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Flogo.png\" alt=\"Margin logo\" width=\"128\" height=\"128\">\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">Margin\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Turn the edges and corners of your touchpad into controls.\u003C\u002Fstrong>\u003Cbr>\n  Slide along an edge for volume, brightness, seeking or Alt+Tab. Press a corner to run anything. You choose what each one does.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg alt=\"Platforms: Windows 10 and 11, Linux\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%7C%20Linux-0078d4\">\n  \u003Cimg alt=\"Built with Rust\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fbuilt%20with-Rust-dea584\">\n  \u003Cimg alt=\"Size: about 0.6 MB\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fbinary-~0.6%20MB-2ea44f\">\n  \u003Cimg alt=\"License: MIT\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fsettings.png\" alt=\"The Margin settings window: the on\u002Foff switch, a map of the touchpad with every edge and corner assigned and the left edge split into volume and brightness halves, and the editor for its bottom half\" width=\"760\">\n\u003C\u002Fp>\n\nMost laptop touchpads only use their middle for gestures. Margin uses the unused strip around the outside:\n\n- **Slide a finger along an edge** to change volume or screen brightness, scrub a video, scroll like the old touchpad scroll strips, zoom, flip through windows or tabs, skip tracks, or switch virtual desktops. No function keys needed. **Split an edge in two** to put two of these on it.\n- **Press or tap a corner** once, twice or three times, or hold it, to run a different action each time: mute, screenshot, lock the PC, open an app or website, press any shortcut, or run a command.\n- **Record your own shortcuts** for each slide direction, so an edge can drive any app.\n- **Change things per app** (Windows): the bottom edge can seek in your video player and switch tabs in your browser. Margin can also **turn itself off while a full-screen game or video is in front**.\n\nEverything in the middle of the touchpad stays a normal touchpad. Margin is one small native program (about 0.6 MB) that needs nothing installed, uses no network and sends no telemetry.\n\n## Install\n\n**Windows 10 \u002F 11.** Open PowerShell and run:\n\n```powershell\nirm https:\u002F\u002Fraw.githubusercontent.com\u002Farxhr007\u002Fmargin\u002Fmain\u002Fscripts\u002Finstall.ps1 | iex\n```\n\n**Linux** (64-bit Intel\u002FAMD, any distribution with systemd). Run in a terminal:\n\n```sh\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Farxhr007\u002Fmargin\u002Fmain\u002Fscripts\u002Finstall.sh | sh\n```\n\nBoth scripts download the latest release, check its SHA-256, install it for your user only, and start it. They are short, so you can [read the Windows one](scripts\u002Finstall.ps1) and [the Linux one](scripts\u002Finstall.sh) first.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Installer options, manual download, build from source\u003C\u002Fb>\u003C\u002Fsummary>\n\n**Windows options** (set before the command):\n\n```powershell\n$env:MARGIN_AUTOSTART = 1          # also start Margin when you sign in\n$env:MARGIN_VERSION = \"v0.4.0\"     # a specific release instead of the latest\n$env:MARGIN_UNINSTALL = 1          # remove Margin (your settings are kept)\n```\n\nIt installs to `%LOCALAPPDATA%\\Programs\\Margin`, adds a Start Menu shortcut and needs no administrator rights. A file fetched this way is not marked as \"downloaded from the internet\", so SmartScreen does not warn about it.\n\n**Linux options** (after `sh -s --`):\n\n```sh\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Farxhr007\u002Fmargin\u002Fmain\u002Fscripts\u002Finstall.sh | sh -s -- --version v0.4.0\n#   --no-service       don't set up the systemd user service\n#   --no-permissions   don't touch udev rules or groups\n#   --uninstall        remove Margin (your settings are kept)\n```\n\nIt installs `~\u002F.local\u002Fbin\u002Fmargin`, does one `sudo` step for the permissions described under [Linux](#linux), and sets up a systemd user service that starts with your desktop session.\n\n**Manual download.** Every [release](..\u002F..\u002Freleases) has `margin.exe` (Windows), `margin-linux-x86_64` and `margin-linux-aarch64` (Linux, static, no dependencies), each with a `.sha256` file. On other CPUs, build from source.\n\n**Build from source** (needs the [Rust toolchain](https:\u002F\u002Frustup.rs); on Windows also the \"Desktop development with C++\" build tools):\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Farxhr007\u002Fmargin.git\ncd margin\ncargo build --release     # target\u002Frelease\u002Fmargin  (margin.exe on Windows)\n```\n\n> The Windows exe is not code-signed. If you download it in a browser, SmartScreen may say \"Windows protected your PC\": choose **More info → Run anyway**. The PowerShell installer avoids this.\n\u003C\u002Fdetails>\n\n## Contents\n\n[Screenshots](#screenshots) · [Using Margin](#using-margin) · [Custom keys](#custom-keys) · [Per-app settings](#per-app-settings) · [Linux](#linux) · [Settings file](#settings-file) · [Troubleshooting](#troubleshooting) · [How it works](#how-it-works) · [Build and test](#build-and-test) · [Related projects](#related-projects) · [Code signing policy](#code-signing-policy) · [Contributing](#contributing) · [License](#license)\n\n## Screenshots\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\">\u003Cimg src=\"docs\u002Fimages\u002Fcustom-keys.png\" alt=\"Custom keys editor with Alt+Tab recorded for the top edge\">\u003Cbr>\u003Csub>\u003Cb>Custom keys.\u003C\u002Fb> Record a shortcut for each slide direction, or pick a preset.\u003C\u002Fsub>\u003C\u002Ftd>\n    \u003Ctd width=\"50%\">\u003Cimg src=\"docs\u002Fimages\u002Fcorner-actions.png\" alt=\"Corner editor with different actions for one, two and three presses and for press and hold\">\u003Cbr>\u003Csub>\u003Cb>Corners.\u003C\u002Fb> One, two or three presses, or a press and hold, each run a different action.\u003C\u002Fsub>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fhud-brightness.png\" alt=\"On-screen display showing Brightness 70%\" height=\"61\">\n  &nbsp;&nbsp;&nbsp;\n  \u003Cimg src=\"docs\u002Fimages\u002Fhud-seek.png\" alt=\"On-screen display showing a seek of 10 seconds\" height=\"61\">\n  \u003Cbr>\u003Csub>The small on-screen display for brightness and seeking on Windows. Volume uses the normal Windows volume flyout.\u003C\u002Fsub>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Flinux-settings.png\" alt=\"The Linux settings page in a browser: touchpad map and the custom keys editor\" width=\"760\">\n  \u003Cbr>\u003Csub>On Linux the settings open as a page in your browser (\u003Ccode>margin settings\u003C\u002Fcode>), with the same map and editors.\u003C\u002Fsub>\n\u003C\u002Fp>\n\n## Using Margin\n\nOn Windows, left-click the tray icon (or launch `margin.exe` again) to open settings. On Linux, run `margin settings`.\n\n### Edges: slide along them\n\nClick an edge on the touchpad map, then choose what sliding along it controls:\n\n| Action | Slide one way | Slide the other way |\n| --- | --- | --- |\n| **Volume** | louder | quieter |\n| **Screen brightness** | brighter | dimmer |\n| **Seek video \u002F audio** | forward (shows `+10s`) | back |\n| **Zoom** | zoom in | zoom out (Ctrl + mouse wheel) |\n| **Switch tabs \u002F windows (Alt+Tab)** | next window | previous window (the Alt+Tab picker stays open until you lift your finger) |\n| **Previous \u002F next track** | next | previous |\n| **Switch virtual desktops** | desktop to the right | desktop to the left |\n| **Custom keys** | your shortcut | your other shortcut |\n| **Scroll** | scroll up (on the top or bottom edge: right) | scroll down (left). Smooth, like dragging a scroll bar; the window under the pointer scrolls |\n\nFor **Scroll**, two more boxes: **Reverse direction (natural scrolling)** makes the page follow your finger instead, and **Keep scrolling after a quick flick** (on by default) lets a fast slide carry on and slow down after you lift your finger, like on a phone. Touching the pad stops it.\n\n**Split an edge in two:** tick **Split in two halves, each with its own action** in the edge's editor, then click a half on the map (or pick it in the list under the box) and choose its action. For example volume on the top half of the left edge and brightness on the bottom half. A slide keeps the action of the half it started in, even when it moves on into the other half. *Needs a click* counts for the whole edge.\n\nSlide **up or right** for \"more \u002F next\" and **down or left** for \"less \u002F previous\". The *Speed* setting changes how far you must slide per step. On Windows, hold **Ctrl + Shift** while sliding for fine steps (not for *Scroll*, where those keys would change what the wheel does).\n\n### Touch or click\n\nEach edge and corner either works by touch or needs the touchpad to click. Tick or untick **Needs a click** in its editor. The **Every edge and corner needs a click** box at the top of the window changes them all at once; it shows a dash when they differ. On Linux, edges always work by touch and the box at the top is for the corners.\n\n- **Edges by touch** (default): bring a finger in from the laptop body onto the edge, then move along it. No click. A finger that first lands inside the touchpad, or any two-finger contact, never triggers it.\n- **Edges that need a click** (Windows): rest a finger on the edge, press until the touchpad clicks, and slide without letting go. The hardest to trigger by accident.\n- **Corners that need a click** (default): press until the touchpad physically clicks. Taps are ignored.\n- **Corners by touch**: a quick tap that doesn't move away counts as a click, and resting the finger still for half a second counts as press and hold. Use this when your touchpad doesn't click everywhere: many only click near the bottom, so the top corners can't be pressed. On Windows the tap's own click is hidden from apps.\n\nOn Windows, while a slide runs the pointer stays still and nothing is clicked underneath.\n\n### Corners: press or tap them\n\nEach corner can run a different action for **1, 2 or 3 presses** (or taps), and one more for **press and hold** (or touch and hold): keep it pressed or touched for half a second.\n\n\nMute · Play \u002F pause · Next \u002F previous track · Screenshot · Task View \u002F overview · Show desktop · Lock the PC · Notifications · **Open an app** · **Open a website** · **Press a shortcut** · **Run a command** · Nothing\n\nDefaults: top-left = show desktop, top-right = Task View (1 press) \u002F notifications (2), bottom-left = lock, bottom-right = play\u002Fpause (1) \u002F next (2) \u002F previous (3). On the edges: left = volume, right = brightness, top = switch windows, bottom = switch virtual desktops.\n\nThe **Edge size** and **Corner size** sliders change how big each zone is. The map always shows the real zones. On Windows, orange dots on the map show where your fingers are on the pad.\n\n### Full-screen apps and games\n\nOn Windows, tick **Turn off while a full-screen app or game is in front** at the top of the settings window, and Margin steps aside whenever the window in front fills the whole screen: a game, a video in full screen, a slideshow. It comes back on by itself when you leave full screen. An ordinary maximized window doesn't count. Off by default, because many people like to change the volume or seek during a full-screen video. On Linux this setting isn't used yet.\n\n## Custom keys\n\nChoose **Custom keys…** for an edge to make it send your own shortcuts. (The ready-made **Switch tabs (Alt+Tab)** entry is fixed; its **Change the keys…** button turns it into Custom keys, starting from Alt+Tab.)\n\n1. Pick a **preset**, or click **Record** next to *Slide right presses* and press the keys.\n2. Do the same for the other direction.\n3. Tick **Hold shared modifiers while sliding** for Alt+Tab-style pickers: the modifiers both shortcuts share (Alt) stay down until you lift your finger.\n\nYour system keeps a few combinations to itself (Alt+Tab, anything with the Windows or Super key), so the Record button can't capture them. **Type them in the box instead.** Shortcut text looks like `Ctrl+Shift+Tab`, `Alt+Tab`, `Win+Ctrl+Right` (`Win` is the Super key on Linux; `Super` and `Meta` mean the same), `Ctrl+PageDown` or `F11`.\n\n| Preset | Slide right \u002F up | Slide left \u002F down | Hold |\n| --- | --- | --- | --- |\n| Switch windows | `Alt+Tab` | `Alt+Shift+Tab` | yes |\n| Switch browser tabs | `Ctrl+Tab` | `Ctrl+Shift+Tab` | no |\n| Next \u002F previous tab | `Ctrl+PageDown` | `Ctrl+PageUp` | no |\n| Scroll | `PageUp` | `PageDown` | no |\n| Arrow keys | `Right` | `Left` | no |\n| Redo \u002F undo | `Ctrl+Y` | `Ctrl+Z` | no |\n\n## Per-app settings\n\nOn Windows, any edge or corner can do something else while a particular app is the window in front. In the settings window, choose **Add an app…** next to **Settings for**, and pick the app's program (for example `vlc.exe`). With that app chosen in the list, click a section on the map and tick **Different in vlc** to give it its own action. Sections with their own action for the chosen app have an orange outline; the rest follow the settings for all apps.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fper-app.png\" alt=\"Settings for vlc: the bottom edge is set to Seek and ticked Different in vlc; it and the bottom-right corner have orange outlines\" width=\"760\">\n\u003C\u002Fp>\n\nMargin checks which app is in front when a slide or press starts, and a slide keeps those settings until you lift your finger, even when it switches to another app (as Alt+Tab does). On Linux, per-app settings in the file are kept but not used, because Wayland has no common way to tell which app is in front.\n\n## Linux\n\nMargin on Linux is a small background program (a systemd user service) plus a settings page in your browser. It works on Wayland and X11 alike, because it reads the touchpad and sends keys at the kernel level instead of talking to a display server. **This is the first Linux release (v0.4.0):** it is tested end to end with a virtual touchpad and in CI, but not yet across many real laptops and desktops, so bug reports are welcome.\n\n```sh\nmargin settings      # open the settings page (it prints a private link and opens your browser)\nmargin --diag        # run in a terminal and print every touch frame and gesture\nmargin config-path   # where settings.json lives (~\u002F.config\u002Fmargin\u002Fsettings.json)\nsystemctl --user status margin\n```\n\n**Requirements:** a touchpad that your system handles as a multitouch device (nearly every modern laptop; old \"semi-MT\" Synaptics pads aren't supported), and systemd for the automatic start (otherwise run `margin` yourself).\n\n### Permissions\n\nMargin needs to **read the touchpad** (`\u002Fdev\u002Finput\u002Fevent*`, group `input`) and **create a virtual keyboard** (`\u002Fdev\u002Fuinput`). The installer does this with one `sudo` step: it adds a udev rule that gives the `input` group access to `\u002Fdev\u002Fuinput`, loads the `uinput` module at boot, and adds you to the `input` group. **Log out and back in once** afterwards. To do it by hand:\n\n```sh\nsudo groupadd -f input && sudo usermod -aG input \"$USER\"\necho 'KERNEL==\"uinput\", MODE=\"0660\", GROUP=\"input\", OPTIONS+=\"static_node=uinput\"' | sudo tee \u002Fetc\u002Fudev\u002Frules.d\u002F60-margin-uinput.rules\necho uinput | sudo tee \u002Fetc\u002Fmodules-load.d\u002Fmargin-uinput.conf\nsudo modprobe uinput && sudo udevadm control --reload-rules && sudo udevadm trigger\n```\n\n> Being in the `input` group lets any program you run read all your input devices, including the keyboard. Margin itself only opens devices that look like touchpads, and its code is small enough to check, but you should know what the group allows.\n\n### What is different from Windows\n\n| | Windows | Linux |\n| --- | --- | --- |\n| Start a slide | slide in from the edge, or press and slide | slide in from the edge only |\n| Pointer while sliding | frozen | still moves (Margin only listens to the touchpad) |\n| Corner presses | hidden from other apps | the press also clicks, wherever the pointer is |\n| Brightness and volume | exact steps, Margin's own on-screen display | media keys: your desktop sets the step and shows its own display |\n| Fine steps (Ctrl+Shift) | yes | not yet |\n| Switch virtual desktops | Ctrl+Win+Left\u002FRight | Ctrl+Super+Left\u002FRight; some desktops use other keys, so use Custom keys there |\n| Settings | native window and tray icon | page in your browser, no tray icon |\n| Per-app settings | yes | not yet: the settings for all apps are used |\n| Turn off in full screen | yes | not yet |\n\n`margin settings` only listens on `127.0.0.1` and every request needs a random key that is part of the link it prints, so other programs and web pages can't change your settings (they could otherwise add a \"run a command\" corner). Changes you make there are applied by the running program within a second.\n\n## Settings file\n\nSettings are saved automatically to `%APPDATA%\\Margin\\settings.json` on Windows and `~\u002F.config\u002Fmargin\u002Fsettings.json` on Linux, so you can also edit them by hand (comments and trailing commas are allowed). The running program applies a saved change within a second. If the file has a mistake, Margin writes the error to its log, keeps a copy of your file as `settings.json.broken`, and carries on with the settings it already had (the defaults, if it was just starting). It won't write over your file until you change something in Margin. The format is the same on both. The example below is shortened: a `sections` list that leaves a zone out leaves it unassigned, so list every zone you want to keep.\n\n```json\n{\n  \"enabled\": true,\n  \"activation\": \"slideIn\",\n  \"speed\": \"medium\",\n  \"edgeDepth\": 0.10,\n  \"cornerSize\": 0.15,\n  \"entryStrip\": 0.04,\n  \"sections\": {\n    \"left\":  { \"slide\": \"volume\", \"secondHalf\": { \"slide\": \"brightness\" } },\n    \"right\": { \"slide\": \"brightness\" },\n    \"top\": {\n      \"slide\": \"custom\",\n      \"forward\": \"Alt+Tab\",\n      \"back\": \"Alt+Shift+Tab\",\n      \"holdModifiers\": true\n    },\n    \"bottomRight\": {\n      \"clicks\": [\n        { \"do\": \"playPause\" },\n        { \"do\": \"nextTrack\" },\n        { \"do\": \"url\", \"value\": \"https:\u002F\u002Fexample.com\" }\n      ],\n      \"longPress\": { \"do\": \"lock\" }\n    }\n  }\n}\n```\n\n| Field | Meaning |\n| --- | --- |\n| `activation` | `slideIn` or `press`: whether edges need a click, unless a section's `needsClick` says otherwise (Windows) |\n| `speed` | `slow`, `medium` or `fast` |\n| `edgeDepth`, `cornerSize` | size of the edge strips and corner squares, as a fraction of the touchpad |\n| `entryStrip` | slide-in mode: how close to the edge a finger must first appear |\n| `sections` | `left`, `right`, `top`, `bottom` (use `slide`) and `topLeft`, `topRight`, `bottomLeft`, `bottomRight` (use `clicks` and `longPress`) |\n| `slide` | `off`, `volume`, `brightness`, `seek`, `zoom`, `tabs`, `tracks`, `desktops`, `custom`, `scroll` |\n| `clicks[].do` | `none`, `mute`, `playPause`, `nextTrack`, `prevTrack`, `screenshot`, `taskView`, `showDesktop`, `lock`, `notifications`, `app`, `url`, `keys`, `command` |\n| `clicks[].value` | the app path, address, shortcut or command line for `app`, `url`, `keys` and `command`. An address without `https:\u002F\u002F`, like `youtube.com\u002Fwatch?v=...`, gets it added |\n| `longPress` | the action for pressing and holding the corner, with the same `do` and `value` as a click |\n| `needsClick` | in a section: `true` needs the touchpad to click, `false` works by touch (a tap for corners). Left out: edges follow `activation`, corners need a click |\n| `reverse` | in a Scroll edge: `true` scrolls the other way (natural scrolling). Left out: `false` |\n| `momentum` | in a Scroll edge: `false` stops scrolling as soon as the finger lifts. Left out: a quick flick keeps scrolling |\n| `secondHalf` | in an edge: splits it in two. The edge's own settings then cover its top half (left and right edges) or left half (top and bottom edges); `secondHalf` holds the other half's `slide`, `forward`, `back`, `holdModifiers`, `reverse` and `momentum`. Left out: one action for the whole edge |\n| `offInFullscreen` | `true`: Margin turns itself off while a full-screen app or game is in front (Windows). Left out: `false` |\n| `apps` | per-app settings (Windows): a list of `{ \"app\": \"vlc\", \"sections\": { ... } }`. `app` is the program's name without `.exe`; its `sections` replace those sections while that app is in front |\n\n## Troubleshooting\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Nothing happens when I slide or press\u003C\u002Fb>\u003C\u002Fsummary>\n\n- Windows: check that you have a precision touchpad (*Settings → Bluetooth & devices → Touchpad* says \"Your PC has a precision touchpad\"). Touchpads with an older, non-precision driver don't report finger positions to Windows, so Margin can't read them.\n- Make sure Margin is on (Windows: the tray menu shows **On** ticked) and the edge or corner is assigned (assigned zones are tinted on the map).\n- Windows: tray menu → **Open log**, or run `margin.exe --diag` from a terminal. Linux: `margin --diag`, or `journalctl --user -u margin`. They show whether Margin sees your finger and what it decides.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>A corner (often a top one) does nothing\u003C\u002Fb>\u003C\u002Fsummary>\n\nMany touchpads only click near the bottom, so a top corner can't be pressed until it clicks. Select the corner and untick **Needs a click**: then a tap runs its action, and resting your finger still for half a second runs its hold action.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Linux: \"cannot read \u002Fdev\u002Finput\u002Fevent…\" or \"cannot create the virtual keyboard\"\u003C\u002Fb>\u003C\u002Fsummary>\n\nMargin lacks the permissions described under [Permissions](#permissions). Run the installer again, or do the manual steps, then **log out and back in**. `id` should list the `input` group, and `ls -l \u002Fdev\u002Fuinput` should show group `input` with `rw`.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Linux: keys are sent but nothing happens in some apps\u003C\u002Fb>\u003C\u002Fsummary>\n\nMargin sends real key events through a virtual keyboard, so the app or desktop decides what they do. Brightness and volume use the media keys, so they work if your desktop reacts to those keys. Window and desktop switching depend on your desktop's own shortcuts; set the keys you want under **Custom keys…**.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Brightness says \"not available\" (Windows)\u003C\u002Fb>\u003C\u002Fsummary>\n\nBrightness uses Windows' built-in display interface, which only exists for a laptop's own screen. External monitors and most desktop PCs don't have it.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Slides start when I only meant to move the pointer\u003C\u002Fb>\u003C\u002Fsummary>\n\nMake the edge smaller with the **Edge size** slider, switch to **Press the edge until it clicks** (Windows), or turn that edge off by setting it to *Nothing*.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>It doesn't work in one particular app (Windows)\u003C\u002Fb>\u003C\u002Fsummary>\n\nWindows doesn't let a normal program send keys to an app that runs **as administrator**. Run Margin as administrator too, or use it with that app closed. Some players use different shortcuts for seeking, so try *Custom keys* for the bottom edge.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>The Record button won't capture Alt+Tab (or Win\u002FSuper combos)\u003C\u002Fb>\u003C\u002Fsummary>\n\nThe system handles those combinations before any program sees them. Type the text into the box instead, for example `Alt+Tab`.\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Another touchpad utility reacts to the same edges\u003C\u002Fb>\u003C\u002Fsummary>\n\nSome vendor touchpad tools (Synaptics, ELAN, Lenovo, ASUS and similar) have their own edge features. If both react, turn one of them off.\n\u003C\u002Fdetails>\n\n## How it works\n\n- **Windows:** Raw Input for the HID digitizer usage page `0x0D` \u002F touchpad `0x05`, parsed with `HidP_*`, so it keeps working while other windows have focus. A `WH_MOUSE_LL` hook hides edge clicks and freezes the pointer. `SendInput` sends keys. Brightness goes through WMI on a background thread. The settings window, tray icon and on-screen display are plain Win32 with per-monitor DPI awareness.\n- **Linux:** the touchpad is read from `\u002Fdev\u002Finput\u002Fevent*` (evdev multitouch protocol B). Keys, media keys and the mouse wheel are sent through virtual `uinput` devices. A tiny local web server serves the settings page.\n- **Shared:** the settings, the touchpad geometry and the whole gesture engine are the same code on both systems.\n\nNo network access, no telemetry. Margin only reads the touchpad and writes your settings and a small log file.\n\n## Build and test\n\n```sh\ncargo build --release      # target\u002Frelease\u002Fmargin  (margin.exe on Windows)\ncargo test                 # unit tests: settings, geometry, shortcuts, the gesture engine, the evdev parser...\n```\n\nTests that use real hardware or the registry are marked `#[ignore]` and run on request (Windows):\n\n```powershell\ncargo test brightness_write -- --ignored --nocapture   # nudges the panel by 1 %, reads it back, restores it\ncargo test startup_round_trip -- --ignored             # writes and removes the \"start with Windows\" value\n```\n\nOn Linux, `tools\u002Flinux-e2e.py` runs the real daemon against a **fake touchpad** created through uinput, performs finger gestures and checks the key events that come out (volume, Alt held through a slide, corner presses, settings reload, custom keys). It needs root and a kernel with uinput, and a desktop would also see the fake touchpad, so use a VM, container or WSL:\n\n```sh\ncargo build --release && sudo python3 tools\u002Flinux-e2e.py target\u002Frelease\u002Fmargin\n```\n\nEverything runs on one thread per program (Windows: one message loop; Linux: one `poll` loop). The gesture logic has no OS calls in it, so it is unit-tested without a touchpad.\n\n| Module | Role |\n| --- | --- |\n| `settings.rs`, `geometry.rs` | settings model and JSON; where each edge and corner sits on the pad |\n| `engine.rs` | the gesture state machine; turns touch frames and clicks into effects (pure, tested) |\n| `keys.rs` | shortcut parsing and key codes; `SendInput` on Windows |\n| `touchpad\u002Fevdev.rs`, `touchpad\u002Ftracker.rs` | evdev event parser (pure, tested on every OS); fingers and button state |\n| `touchpad\u002Fraw.rs`, `hook.rs`, `brightness.rs`, `hud.rs`, `tray.rs`, `ui\u002F`, `app.rs`, ... | Windows: Raw Input, mouse hook, WMI, on-screen display, tray, settings window |\n| `linux\u002F` | Linux: device discovery, daemon loop, uinput output, corner actions, settings web server and page |\n\n`build.rs` embeds the Windows manifest (per-monitor DPI, visual styles), version info and an icon generated from the same drawing code the tray uses. A [GitHub Actions workflow](.github\u002Fworkflows\u002Fbuild.yml) tests on Linux and Windows for every push and pull request. When `version` in `Cargo.toml` changes on `main`, it also builds the release binaries (including Linux arm64), tags the version and publishes the release.\n\nVersions up to 0.2.1 were written in C# on .NET 8. That code is still in the git history and in the [v0.2.1 tag](..\u002F..\u002Ftree\u002Fv0.2.1); the Rust version reads and writes the same `settings.json`.\n\n## Related projects\n\nMargin is not the only app that uses touchpad edges. If it doesn't fit your needs, these are worth a look:\n\n- [Brim](https:\u002F\u002Fgithub.com\u002Fjoelgjojo\u002Fbrim): edge controls for the Mac trackpad, with a Windows beta.\n- [EdgeSlide](https:\u002F\u002Fgithub.com\u002Fputtingpixelstogether-ops\u002Fedgeslide): Windows tray app that turns the left and right touchpad edges into brightness and volume sliders.\n\n## Code signing policy\n\nFree code signing provided by [SignPath.io](https:\u002F\u002Fabout.signpath.io), certificate by [SignPath Foundation](https:\u002F\u002Fsignpath.org).\n\nWindows releases are built from this repository by the [release workflow](.github\u002Fworkflows\u002Fbuild.yml) and signed there; nothing is signed by hand. Setup and checks are in [docs\u002Fsigning.md](docs\u002Fsigning.md).\n\n- Committers and reviewers: [arxhr007](https:\u002F\u002Fgithub.com\u002Farxhr007)\n- Approvers: [arxhr007](https:\u002F\u002Fgithub.com\u002Farxhr007)\n\nPrivacy: this program will not transfer any information to other networked systems unless specifically requested by the user or the person installing or operating it.\n\n## Contributing\n\nBug reports from real laptops help most, since touchpads differ a lot. See [CONTRIBUTING.md](CONTRIBUTING.md) for what to include in a report and how to build, test and send changes. Everyone taking part is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","Margin 是一款轻量级触控板边缘控制工具，将触控板四周边缘和角落映射为系统快捷操作。核心功能包括：沿边缘滑动调节音量\u002F亮度\u002F媒体进度，按压角落触发单击\u002F双击\u002F长按等多级自定义命令（如截图、锁屏、运行脚本），支持应用级配置（如视频播放器中底部边缘用于拖拽进度，浏览器中用于切标签），并可自动在全屏游戏或视频时禁用。基于 Rust 编写，原生二进制（约 0.6 MB），无运行时依赖、无网络请求、无遥测，兼容 Windows 10\u002F11 与 Linux（evdev\u002FPrecision Touchpad）。适用于追求高效触控交互、减少键盘依赖的笔记本用户。",2,"2026-11-24 04:54:10","CREATED_QUERY"]