{"id":24380784,"url":"https://github.com/lzinga/xmap","last_synced_at":"2025-09-20T23:20:45.808Z","repository":{"id":96438401,"uuid":"132709917","full_name":"lzinga/XMap","owner":"lzinga","description":"Execute macros in windows using XInput.","archived":false,"fork":false,"pushed_at":"2018-05-13T01:05:31.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T08:43:10.801Z","etag":null,"topics":["macros","xbox","xbox-controller","xinput"],"latest_commit_sha":null,"homepage":"","language":"C#","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/lzinga.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}},"created_at":"2018-05-09T06:10:54.000Z","updated_at":"2021-04-10T07:38:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"0fc5ed82-fe52-4f42-b9dc-407a25d78c34","html_url":"https://github.com/lzinga/XMap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lzinga/XMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzinga%2FXMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzinga%2FXMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzinga%2FXMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzinga%2FXMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzinga","download_url":"https://codeload.github.com/lzinga/XMap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzinga%2FXMap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276169966,"owners_count":25597031,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["macros","xbox","xbox-controller","xinput"],"created_at":"2025-01-19T08:29:08.312Z","updated_at":"2025-09-20T23:20:45.791Z","avatar_url":"https://github.com/lzinga.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XMap\nA Windows XInput Manager for binding controller keys to custom macros. I created this because I couldn't find anything out there\nthat fit what I wanted and was free. So I wrote my own! To those interested in helping please make a [pull request](https://github.com/lzinga/XMap/pulls), I\nam sure there is some improvements that could be made and I welcome them!\n\nIf you can't contribute directly in programming but have a problem just open an [issue](https://github.com/lzinga/XMap/issues) and hopefully I or someone\nelse can get to it!\n\n# XML Macro Config file\nXMap loads an xml file from the `\\Configs\\` folder, right now it only supports a predefined one but will probably make it support more later. Here is an example of a fully working config file that I created for myself. Past it, you will find a list of all actions/conditions currently available.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-16\"?\u003e\n\u003cMapping xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\u003e\n  \u003cMacro Name=\"Stop Project64\"\u003e\n    \u003cConditions\u003e\n      \u003cCondition xsi:type=\"ButtonsPressed\" Key=\"Start, Back\" /\u003e\n      \u003cCondition xsi:type=\"Hold\" Key=\"5\" /\u003e\n    \u003c/Conditions\u003e\n    \u003cActions\u003e\n      \u003cAction xsi:type=\"Key\" Modifier=\"Shift\" Key=\"F8\" /\u003e\n      \u003cAction xsi:type=\"Vibrate\" Amount=\"25\" Duration=\"1\" /\u003e\n    \u003c/Actions\u003e\n  \u003c/Macro\u003e\n\u003c/Mapping\u003e\n```\n\n\n### Conditions\nA Macro requires conditions, XMap will check these conditions on button presses to see if any of them match.\nIf one matches it will execute the `Actions` (see the actions area below).\n\nThe following XML conditions are all currently available and working (as far as I know). Each macro is checked based on the amount of conditions\nthey have. So ones with the most are checked first, and the ones with the least are checked last.\n```xml\n\u003cConditions\u003e\n    \u003c!-- Checks if the current active process being interacted with is the `Key` --\u003e\n    \u003cCondition xsi:type=\"ActiveProcess\" Key=\"Discord.exe\" /\u003e\n\n    \u003c!-- Checks if the left trigger is greater or equal to the `Key` value. (0-100) --\u003e\n    \u003cCondition xsi:type=\"LeftTrigger\" Key=\"100\" /\u003e\n\n    \u003c!-- Checks if the right trigger is greater or equal to the `Key` value. (0-100) --\u003e\n    \u003cCondition xsi:type=\"RighTrigger\" Key=\"50\" /\u003e\n\n    \u003c!-- Checks if the current combination of buttons is equal to `Key` value. (Buttons must be entered as they appear below) --\u003e\n    \u003c!-- For example, if you wanted DpadLeft, Start, and A it would be written as 'DpadLeft, Start, A', case doesn't matter but spaces do (for now)--\u003e\n    \u003c!-- DPadUp, DpadDown, DpadLeft, DpadRight, Start, Back, LeftThumb, RightThumb, LeftShoulder, RightShoulder, A, B, X, Y --\u003e\n    \u003cCondition xsi:type=\"ButtonsPressed\" Key=\"A, B\" /\u003e\n\n    \u003c!-- Checks if the buttons have been held for a certain amount of seconds using `Key` value. (In seconds) --\u003e\n    \u003cCondition xsi:type=\"Hold\" Key=\"5\" /\u003e\n\u003c/Conditions\u003e\n```\n\n### Actions\nWhen the specified conditions are met using the aforementioned structure the actions will be executed.\nTo also note, all actions will be executed in what ever application is currently the active window.\n```xml\n\u003cActions\u003e\n    \u003c!-- Presses the keys with the included modifiers, each new letter/modifier should be separated with a comma. --\u003e\n    \u003cAction xsi:type=\"Key\" Modifier=\"Control, Shift\" Key=\"A\" /\u003e\n\n    \u003c!-- Will output text. --\u003e\n    \u003cAction xsi:type=\"Text\" Key=\"This text will appear where ever the cursor is located!\" /\u003e\n\n    \u003c!-- Will make the controller vibrate. (Duration can be a double value) --\u003e\n    \u003cAction xsi:type=\"Vibrate\" Amount=\"(1-100)\"  Duration=\"1\" /\u003e\n\u003c/Actions\u003e\n```\n\n### Creation of Actions and Conditions\nTo create an action or condition all you have to do is create a new class and inherit the `BaseAction` or `BaseCondition` object. Here are two examples showing what an action and a condition look like -\n\n#### Action\n```csharp\n[XmlType(TypeName = \"Text\")]\npublic class TextAction : BaseAction\n{\n    [XmlAttribute]\n    public string Key { get; set; }\n\n    public override void Execute()\n    {\n        this.input.Text(this.Key);\n    }\n\n    public override string ToString()\n    {\n        return $\"Writing \\\"{this.Key}\\\".\";\n    }\n}\n```\n\n#### Condition\n```csharp\n[XmlType(TypeName = \"Hold\")]\npublic class HoldCondition : BaseCondition\n{\n    [XmlAttribute]\n    public int Key { get; set; }\n\n    public override bool Validate(XInputControllerState controller, WindowManager window)\n    {\n        if (controller.CurrentHoldTime.TotalSeconds \u003e= this.Key \u0026\u0026 controller.HoldingButtons)\n        {\n            return true;\n        }\n        return false;\n    }\n\n    public override string ToString()\n    {\n        return $\"{this.GetType().Name}: has it been held for {this.Key} seconds?\";\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzinga%2Fxmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzinga%2Fxmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzinga%2Fxmap/lists"}