├── CMakeLists.txt ├── LICENSE ├── README.md ├── doc ├── README.md ├── advanced │ ├── 1-mappings.md │ └── README.md ├── basic │ ├── 1-installation.md │ ├── 2-startup.md │ ├── 3-devices.md │ ├── 4-keybinds.md │ ├── 5-macros.md │ ├── 6-profiles.md │ └── README.md └── reference │ ├── README.md │ ├── command │ ├── README.md │ ├── addaction.md │ ├── clearactions.md │ ├── clearmacro.md │ ├── copyactions.md │ ├── copymacro.md │ ├── copymap.md │ ├── copyprofile.md │ ├── delaction.md │ ├── delmacro.md │ ├── delmacroact.md │ ├── delmap.md │ ├── delprofile.md │ ├── disable.md │ ├── enable.md │ ├── insmacroact.md │ ├── listactions.md │ ├── listbinds.md │ ├── listdevices.md │ ├── listmacros.md │ ├── listmaps.md │ ├── listprofiles.md │ ├── newmacro.md │ ├── newmap.md │ ├── newprofile.md │ ├── recordmacro.md │ ├── showmacro.md │ ├── switchmap.md │ ├── switchprofile.md │ ├── version.md │ └── whichkey.md │ └── internal │ ├── README.md │ └── plugin-bts.md ├── etc └── xdg │ └── autostart │ └── input-modifier.desktop ├── eventnames.sh ├── lib └── udev │ └── rules.d │ └── 99-imod.rules └── src ├── autostart └── imodd-wrapper.in ├── cli ├── cli.c └── main.cpp ├── daemon ├── command.cpp ├── device.cpp ├── imodd.h ├── listener.cpp ├── log.cpp ├── main.cpp ├── names.c ├── names.h ├── plugin.cpp ├── plugin │ ├── razer │ │ ├── CMakeLists.txt │ │ ├── dbus.cpp │ │ ├── razer.cpp │ │ └── razer.h │ ├── skeleton.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── test.cpp │ │ └── test.h ├── scanner.cpp ├── socket.cpp ├── state.cpp └── time.cpp ├── installer ├── 98-imod-ubuntu14.rules ├── install ├── makeinstall └── uninstall └── json ├── json.hpp └── notes.md /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(input-modifier) 3 | 4 | set(CMAKE_CXX_STANDARD 11) 5 | 6 | add_executable(imodd 7 | src/daemon/log.cpp 8 | src/daemon/time.cpp 9 | src/daemon/names.c 10 | src/daemon/scanner.cpp 11 | src/daemon/listener.cpp 12 | src/daemon/device.cpp 13 | src/daemon/state.cpp 14 | src/daemon/command.cpp 15 | src/daemon/socket.cpp 16 | src/daemon/plugin.cpp 17 | src/daemon/main.cpp) 18 | 19 | add_executable(imod-cli 20 | src/cli/cli.c) 21 | 22 | add_executable(imod-newcli 23 | src/cli/main.cpp) 24 | 25 | add_subdirectory(src/daemon/plugin/test) 26 | add_subdirectory(src/daemon/plugin/razer) 27 | 28 | target_link_libraries(imodd dl pthread) 29 | 30 | target_compile_definitions(imodd PUBLIC _PREFIX="${CMAKE_INSTALL_PREFIX}") 31 | 32 | install(TARGETS imodd RUNTIME DESTINATION bin) 33 | install(TARGETS imod-cli RUNTIME DESTINATION bin) 34 | 35 | install(DIRECTORY lib/udev DESTINATION lib) 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # input-modifier 2 | 3 | uinput based key bindings and macros tool for Linux. 4 | 5 | The purpose of this project is to allow the user to assign actions to keys, which can come in handy if you want to do repetitive actions easily (e.g. tap a key repeatedly by simply holding it or launch a sequence of keys with a single keypress), launch applications using keys, disabling keys you don't want to be pressed by accident, mapping gaming keypads, etc. 6 | 7 | **Comparison with Xdotool** 8 | 9 | The advantages over [Xdotool](https://github.com/jordansissel/xdotool) are: 10 | 11 | - Interacts with the evdev input layer, which is lower-level than X. 12 | - Works outside X, e.g. VT or Wayland. 13 | 14 | The disadvantages are: 15 | 16 | - You can't directly map a key to closing a window, or something that has to do with X (however, you can execute xdotool from input-modifier). 17 | 18 | **Comparison with AutoKey** 19 | 20 | The advantages over [AutoKey](https://github.com/autokey/autokey) are: (although I've never used it) 21 | 22 | - Is written in C++, which means less overhead than Python. 23 | - Allows for doing things like remapping keys (besides executing applications and running macros) without resorting to complex hacks. 24 | 25 | The disadvantages are: 26 | 27 | - No GUI yet. 28 | - Does not allow for DE-specific actions or X11-specific ones (but I am pretty sure it may be possible to use both programs in tandem). 29 | 30 | 31 | # installation 32 | 33 | ## Arch Linux 34 | 35 | [AUR](https://aur.archlinux.org/packages/input-modifier/). 36 | 37 | ## universal installer 38 | 39 | download the installer from [here](https://github.com/tildearrow/input-modifier/releases) (select the first element from "Assets"). 40 | 41 | extract release: 42 | 43 | ``` 44 | tar -xvf .tar.gz 45 | ``` 46 | 47 | run the installer: 48 | 49 | ``` 50 | cd input-modifier 51 | sudo ./install 52 | ``` 53 | 54 | add yourself to the `input` group if not done previously: 55 | 56 | ``` 57 | sudo usermod -a -G input $USER 58 | ``` 59 | 60 | and then re-login. 61 | 62 | # running 63 | 64 | run imodd: 65 | 66 | ``` 67 | imodd 68 | ``` 69 | 70 | # usage 71 | 72 | documentation can be found [here](doc/README.md). 73 | 74 | # to-do 75 | 76 | - X11 integration (per-application profile bind, warping cursor and the like). 77 | 78 | - bug fixes. 79 | 80 | - proper packages. 81 | 82 | - passing environment variables to execute. 83 | 84 | - changing the weird devices setting. 85 | - I will talk about this later 86 | 87 | - ignoring non-input devices such as the Firefly or Polaris. 88 | 89 | - fix pressing non-bit-set keys. 90 | 91 | - implement binds for relative and switch events. 92 | 93 | - add feature here. 94 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # input-modifier documentation 2 | 3 | thank you for finding this program! i hope it will be useful to you. 4 | 5 | input-modifier is a small utility that allows you to remap your devices, and/or assign actions to its buttons. 6 | 7 | please note that this documentation is a work in progress, and as such it is not complete and may have flaws. 8 | 9 | - [basic usage](basic/README.md) 10 | - [advanced usage](advanced/README.md) 11 | - [reference](reference/README.md) 12 | -------------------------------------------------------------------------------- /doc/advanced/1-mappings.md: -------------------------------------------------------------------------------- 1 | # mappings 2 | 3 | input-modifier is also capable of having multiple "mappings" for a profile, with the ability to switch them on the fly. 4 | 5 | ## but there are profiles 6 | 7 | yes, I know, but there are differences: 8 | 9 | - profiles contain, besides mappings, device/integration settings. 10 | - a profile has to be loaded from files, while mappings are already loaded and switchable on the fly. 11 | 12 | furthermore, every single other tool in Windows land I've seen (especially for keypads) have both mappings and profiles. 13 | 14 | ## listing mappings 15 | 16 | to see mappings for a device, type, e.g.: 17 | 18 | ``` 19 | > listmaps 20 | ``` 21 | 22 | at first the only mapping available is called "Default". 23 | 24 | ## creating a mapping 25 | 26 | to create a new mapping, type something like: 27 | 28 | ``` 29 | > newmap map2 30 | ``` 31 | 32 | (`map2` being the mapping's name) 33 | 34 | (note that mapping names can't have spaces) 35 | 36 | ## copying a mapping 37 | 38 | if you want to copy a mapping, type something like: 39 | 40 | ``` 41 | > copymap oldMap newMap 42 | ``` 43 | 44 | ## deleting a mapping 45 | 46 | if you want to get rid of a mapping, you can do so: 47 | 48 | ``` 49 | > delmap map2 50 | ``` 51 | 52 | but first make sure that's not the current mapping. 53 | 54 | ## switching between mappings (using the command line) 55 | 56 | ``` 57 | > switchmap map2 58 | ``` 59 | 60 | ## binding a mapping to a key 61 | 62 | ``` 63 | > addaction KEY_RIGHTMETA switchmap map2 64 | ``` 65 | 66 | ## mapping shifting 67 | 68 | mapping shifting is an ability of input-modifier in where you hold a key to temporarily activate a mapping. 69 | 70 | ``` 71 | > addaction KEY_RIGHTMETA shiftmap map2 72 | ``` 73 | 74 | ## adding actions to a mapping without changing mappings 75 | 76 | yes, you can. as an example: 77 | 78 | ``` 79 | > addaction @mapName KEY_LSHIFT macro macro1 80 | ``` 81 | 82 | (replace `@mapName` with the mapping's name preceded by an at symbol (`@`), for example, `@map2`) 83 | 84 | the commands `listactions`, `clearactions`, `delaction` and `listbinds` also have this feature: 85 | 86 | ``` 87 | > listbinds @map2 88 | ``` 89 | -------------------------------------------------------------------------------- /doc/advanced/README.md: -------------------------------------------------------------------------------- 1 | ## advanced usage 2 | 3 | this covers advanced usage of input-modifier. 4 | 5 | 1. [mappings](1-mappings.md) 6 | 2. [macros](2-macros.md) 7 | 8 | TODO 9 | -------------------------------------------------------------------------------- /doc/basic/1-installation.md: -------------------------------------------------------------------------------- 1 | # installation (distro-specific) 2 | 3 | ## Arch Linux 4 | 5 | install [input-modifier](https://aur.archlinux.org/packages/input-modifier/). from the AUR (either manually or with your favorite helper). 6 | 7 | # installation (universal installer) 8 | 9 | download the installer from [here](https://github.com/tildearrow/input-modifier/releases) (don't download the source code versions!). 10 | 11 | after downloading input-modifier, please follow these instructions for a proper install. 12 | 13 | ## extracting 14 | 15 | input-modifier comes in a universal binary package, besides some distribution-specific packages. this means it will work with any distribution. this is possible because input-modifier has no dependencies other than udev, which is found in almost every single modern distro. 16 | 17 | input-modifier doesn't run as root, to allow for multi-user support in the future. 18 | 19 | to install input-modifier, first extract the installer. and type the following in a terminal: 20 | 21 | ``` 22 | tar -xvf 23 | ``` 24 | 25 | (replace with the name of the input-modifier package, e.g. `imod-v1.2-x86_64.tar.gz`) 26 | 27 | this will extract the installer to a directory named `input-modifier`. 28 | 29 | to run the installer, type: 30 | 31 | ``` 32 | cd input-modifier 33 | sudo ./install 34 | ``` 35 | 36 | this will install input-modifier to your system after you accept the prompts. 37 | 38 | ## input group 39 | 40 | input-modifier opens input devices (of course), so it requires you to be in the `input` group. 41 | 42 | you can add yourself to that group by typing the following: 43 | 44 | ``` 45 | sudo usermod -a -G input $USER 46 | ``` 47 | 48 | after this, you'll have to re-login before being able to use input-modifier, since new groups don't apply until you do this. 49 | 50 | under special circumstances, a reboot may be necessary. 51 | 52 | after this, you're ready to go. see [startup](2-startup.md). 53 | 54 | ## what about an AppImage? 55 | 56 | this can't happen, because of the udev rule that has to be installed. 57 | 58 | plus input-modifier has no dependencies, so it wouldn't make sense. 59 | -------------------------------------------------------------------------------- /doc/basic/2-startup.md: -------------------------------------------------------------------------------- 1 | # startup 2 | 3 | congratulations on installing input-modifier. here you will learn how to use it. 4 | 5 | ## start the daemon 6 | 7 | after you've installed input-modifier, run the following: 8 | 9 | ``` 10 | imodd 11 | ``` 12 | 13 | this will start the input-modifier daemon. if it fails, make sure you have installed it correctly. if that is the case, you may want to report an issue and I'll be glad to fix it as soon as you do. 14 | 15 | if you see the following: 16 | 17 | ``` 18 | [info] done! running. 19 | ``` 20 | 21 | then it means you've done everything correctly. let's move on to [devices](3-devices.md). 22 | 23 | ## but wait. what about autostart? 24 | 25 | that's something marked as to-do. but it will eventually happen. 26 | 27 | for now, you'll have to start the input-modifier daemon manually. 28 | -------------------------------------------------------------------------------- /doc/basic/3-devices.md: -------------------------------------------------------------------------------- 1 | # devices 2 | 3 | after you've started the input-modifier daemon, you might be wondering how to control the program. 4 | 5 | this is done by using a little utility called `imod-cli`, which is a command-line interface to input-modifier. 6 | 7 | (don't worry, a GUI will come at some point) 8 | 9 | to open up the utility, type the following in a new terminal (because the terminal you used to start up input-modifier is now occupied): 10 | 11 | ``` 12 | imod-cli 13 | ``` 14 | 15 | if you've done this correctly, you should be at the input-modifier prompt: 16 | 17 | ``` 18 | > 19 | ``` 20 | 21 | now you can begin typing commands. 22 | 23 | ## but what is better for me to do first? 24 | 25 | to list your devices. to do so, type the following at the prompt: 26 | 27 | ``` 28 | > listdevices 29 | ``` 30 | 31 | this will return something like: 32 | 33 | ``` 34 | 0: Keyboard 35 | 1: Mouse 36 | Ready. 37 | ``` 38 | 39 | the numbers at the left side are device indexes, which may change at any time (and as such discouraged to use in furthercoming commands). 40 | 41 | the names at the right side are your device's names, which you can use in the next commands. 42 | 43 | ## enabling devices 44 | 45 | these devices are in the "disabled" state when they are first detected by input-modifier. 46 | this means keybindings, macros, or the like won't work. 47 | 48 | to enable a device, type the following: 49 | 50 | ``` 51 | > enable 52 | ``` 53 | 54 | where `` is your device's name. note that you don't have to type the full name, for convenience. 55 | 56 | as an example: 57 | 58 | ``` 59 | > enable Keyboard 60 | ``` 61 | 62 | enables the device "Keyboard". you may also type: 63 | 64 | ``` 65 | > enable key 66 | ``` 67 | 68 | and it will have an equivalent effect. 69 | 70 | to disable a device, in case you don't want it to do keybindings anymore, do: 71 | 72 | ``` 73 | > disable 74 | ``` 75 | 76 | for example: 77 | 78 | ``` 79 | > disable keyboard 80 | ``` 81 | 82 | following is [keybinds](4-keybinds.md). the moment you've been waiting for. 83 | 84 | ## device name notes 85 | 86 | if your device's name contains spaces, then typing the device's name with spaces won't work. 87 | 88 | however, you may still type only a portion of its name. as an example, if your device's called "Razer Ornata Chroma", you only have to type "ornata" or similar. 89 | 90 | ``` 91 | > enable ornata 92 | ``` 93 | -------------------------------------------------------------------------------- /doc/basic/4-keybinds.md: -------------------------------------------------------------------------------- 1 | # keybinds 2 | 3 | this is probably to you the most important part of this entire documentation. 4 | 5 | input-modifier's main purpose is to let you bind certain keys to actions. 6 | 7 | whenever you add actions to a key, that key no longer serves its original purpose. 8 | 9 | ## remapping keys 10 | 11 | say you want to remap the tab key to the A key. 12 | 13 | to do that, type the following: 14 | 15 | ``` 16 | > addaction KEY_TAB key KEY_A 17 | ``` 18 | 19 | (replace `` with your device's name; see [devices](3-devices.md) for notes) 20 | 21 | (if you're wondering what the key names are, see the following: [input-event-codes.h](https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h)) 22 | 23 | ## I am lost 24 | 25 | if you're unsure of a key's name, you can retrieve it by doing: 26 | 27 | ``` 28 | > whichkey 29 | ``` 30 | 31 | and then pressing the key in question. 32 | 33 | ## multiple keys 34 | 35 | yes, you can. 36 | 37 | ``` 38 | > addaction KEY_TAB key KEY_LEFTCTRL 39 | > addaction KEY_TAB key KEY_LEFTALT 40 | > addaction KEY_TAB key KEY_ESC 41 | ``` 42 | 43 | after doing this, you've just bound the tab key to Ctrl-Alt-Esc. 44 | 45 | ## quick triggering 46 | 47 | say you want the side button in your mouse to do fast clicks. 48 | 49 | ``` 50 | > addaction BTN_SIDE turbo BTN_LEFT 0.04 0.04 51 | ``` 52 | 53 | (replace `` with your mouse's name) 54 | 55 | the first 0.04 is the press time, and the next one is the release time. 56 | all units in seconds. 57 | 58 | ## disabling keys 59 | 60 | say you want to disable the Meta/Windows key. you may do so by typing the following: 61 | 62 | ``` 63 | > addaction KEY_LEFTMETA disable 64 | ``` 65 | 66 | ## finding out which keys are bound 67 | 68 | this command will do: 69 | 70 | ``` 71 | > listbinds 72 | ``` 73 | 74 | ## I made a mistake 75 | 76 | if you made any mistakes you can delete an action. 77 | 78 | first find out the action index: 79 | 80 | ``` 81 | > listactions KEY_TAB 82 | ``` 83 | 84 | then delete the action, e.g.: 85 | 86 | ``` 87 | > delaction KEY_TAB 2 88 | ``` 89 | 90 | (`2` being the action index) 91 | 92 | ## resetting a key 93 | 94 | you can reset a key to its default state by typing: 95 | 96 | ``` 97 | > clearactions KEY_TAB 98 | ``` 99 | 100 | ## the rest 101 | 102 | there are more actions available, but they aren't listed here. once you hit the advanced usage section, you'll learn about them. 103 | 104 | alternatively, check out the [addaction reference](../reference/command/addaction.md). 105 | 106 | now, let's look at [macros](5-macros.md). 107 | -------------------------------------------------------------------------------- /doc/basic/5-macros.md: -------------------------------------------------------------------------------- 1 | # macros 2 | 3 | besides key rebinding, input-modifier is also capable of macros. 4 | 5 | macros are sequences of timed keypresses which can be anything from pressing a simple key combo to typing text to executing a winning move/strategy. 6 | 7 | ## creating a macro 8 | 9 | to create a macro, type: 10 | 11 | ``` 12 | > newmacro macro1 13 | ``` 14 | 15 | (`macro1` being the macro's name) 16 | 17 | (note that macro names can't have spaces) 18 | 19 | ## recording to a macro 20 | 21 | the easiest way to prepare a macro is to simply record to it. to do so: 22 | 23 | ``` 24 | > recordmacro macro1 25 | ``` 26 | 27 | (make sure you've created the macro first) 28 | 29 | this will begin recording from your ``. this means any keypresses in other devices won't be registered. 30 | 31 | to finish recording, press ESC. 32 | 33 | ## assigning your macro 34 | 35 | to assign your macro to a key (e.g. right control), do the following: 36 | 37 | ``` 38 | > addaction KEY_RIGHTCTRL macro macro1 39 | ``` 40 | 41 | ## I made a mistake 42 | 43 | don't worry. you can clear your macro by doing: 44 | 45 | ``` 46 | > clearmacro macro1 47 | ``` 48 | 49 | alternatively, you can delete the macro: 50 | 51 | ``` 52 | > delmacro macro1 53 | ``` 54 | 55 | ## showing your macro 56 | 57 | to see your macro's actions: 58 | 59 | ``` 60 | > showmacro macro1 61 | ``` 62 | 63 | ## listing available macros 64 | 65 | to see your macros, type the following: 66 | 67 | ``` 68 | > listmacros 69 | ``` 70 | 71 | ## why not manually create the macro? 72 | 73 | yes, you can. 74 | 75 | it is much harder to do, but it is possible. 76 | 77 | to insert a keypress, type e.g.: 78 | 79 | ``` 80 | > insmacroact macro1 key KEY_A 1 81 | ``` 82 | 83 | to insert a key release, type e.g.: 84 | 85 | ``` 86 | > insmacroact macro1 key KEY_A 0 87 | ``` 88 | 89 | to insert a delay, type e.g.: 90 | 91 | ``` 92 | > insmacroact macro1 wait 0.2 93 | ``` 94 | 95 | (time in seconds) 96 | 97 | if you make a mistake, you can type: 98 | 99 | ``` 100 | > showmacro macro1 101 | ``` 102 | 103 | then look at the action index you want to delete, and then type: 104 | 105 | ``` 106 | > delmacroact macro1 5 107 | ``` 108 | 109 | (the ability to edit actions in-place is coming soon) 110 | 111 | next page is [profiles](6-profiles.md). 112 | -------------------------------------------------------------------------------- /doc/basic/6-profiles.md: -------------------------------------------------------------------------------- 1 | # profiles 2 | 3 | besides keybindings and macros, input-modifier also does profile management. 4 | 5 | profiles are per-device, if you were wondering. 6 | 7 | ## listing profiles 8 | 9 | to see your profiles for a device, type, e.g.: 10 | 11 | ``` 12 | > listprofiles 13 | ``` 14 | 15 | at first you'll have a single profile called "Default". 16 | 17 | ## creating a profile 18 | 19 | to create a new profile, type something like: 20 | 21 | ``` 22 | > newprofile profile2 23 | ``` 24 | 25 | (`profile2` being the profile's name) 26 | 27 | (note that profile names can't have spaces) 28 | 29 | ## switching to that profile 30 | 31 | now to switch to that profile type: 32 | 33 | ``` 34 | > switchprofile profile2 35 | ``` 36 | 37 | ## copying a profile 38 | 39 | if you have an existing profile and you want to copy it to a new one, type something like: 40 | 41 | ``` 42 | > copyprofile oldProfile newProfile 43 | ``` 44 | 45 | ## deleting a profile 46 | 47 | if you want to get rid of a profile, you can do so: 48 | 49 | ``` 50 | > delprofile profile2 51 | ``` 52 | 53 | but first make sure that's not the current profile. 54 | 55 | congratulations, you have learned how to use input-modifier! but that's not all. there's more in the [advanced](../advanced/README.md) section! 56 | -------------------------------------------------------------------------------- /doc/basic/README.md: -------------------------------------------------------------------------------- 1 | ## basic usage 2 | 3 | this covers basic usage of input-modifier. 4 | 5 | 1. [installation](1-installation.md) 6 | 2. [startup](2-startup.md) 7 | 3. [devices](3-devices.md) 8 | 4. [keybinds](4-keybinds.md) 9 | 5. [macros](5-macros.md) 10 | 6. [profiles](6-profiles.md) 11 | -------------------------------------------------------------------------------- /doc/reference/README.md: -------------------------------------------------------------------------------- 1 | # reference 2 | 3 | input-modifier reference. 4 | 5 | [command reference](command/README.md) 6 | [internals](internal/README.md) 7 | -------------------------------------------------------------------------------- /doc/reference/command/README.md: -------------------------------------------------------------------------------- 1 | # input-modifier command reference 2 | 3 | ## device 4 | 5 | - [listdevices](listdevices.md) 6 | - [enable](enable.md) 7 | - [disable](disable.md) 8 | 9 | ## mapping 10 | 11 | - [listmaps](listmaps.md) 12 | - [newmap](newmap.md) 13 | - [copymap](copymap.md) 14 | - [delmap](delmap.md) 15 | - [switchmap](switchmap.md) 16 | 17 | ## action 18 | 19 | - [listbinds](listbinds.md) 20 | 21 | - [listactions](listactions.md) 22 | - [addaction](addaction.md) 23 | - [copyactions](copyactions.md) 24 | - [delaction](delaction.md) 25 | - [clearactions](clearactions.md) 26 | 27 | ## macro 28 | 29 | - [listmacros](listmacros.md) 30 | - [newmacro](newmacro.md) 31 | - [copymacro](copymacro.md) 32 | - [delmacro](delmacro.md) 33 | - [showmacro](showmacro.md) 34 | - [clearmacro](clearmacro.md) 35 | - [recordmacro](recordmacro.md) 36 | 37 | - [insmacroact](insmacroact.md) 38 | - [delmacroact](delmacroact.md) 39 | 40 | ## profile 41 | 42 | - [listprofiles](listprofiles.md) 43 | - [newprofile](newprofile.md) 44 | - [copyprofile](copyprofile.md) 45 | - [delprofile](delprofile.md) 46 | - [switchprofile](switchprofile.md) 47 | 48 | ## program 49 | 50 | - [version](version.md) 51 | -------------------------------------------------------------------------------- /doc/reference/command/addaction.md: -------------------------------------------------------------------------------- 1 | # addaction 2 | 3 | adds an action to an event. 4 | 5 | ## usage 6 | 7 | ``` 8 | addaction [@keymap] ... 9 | ``` 10 | 11 | if no keymap is specified, the current keymap is altered. 12 | 13 | the command's arguments vary depending on the action type. 14 | these are documented below. 15 | 16 | ## action types 17 | 18 | ### key 19 | 20 | this is a simple keypress action. useful for rebinding. 21 | 22 | ``` 23 | addaction [@keymap] key 24 | ``` 25 | 26 | ### turbo 27 | 28 | this action turns a key into a "retrigger"-like button. 29 | 30 | ``` 31 | addaction [@keymap] turbo 32 | ``` 33 | 34 | the specified key will be fired in the following pattern: 35 | 36 | ``` 37 | ON > (timeOn seconds) > OFF > (timeOff seconds) > ON > (timeOn seconds) > OFF > (timeOff seconds) > ... 38 | ``` 39 | 40 | until the mapped key is released. 41 | 42 | ### relative 43 | 44 | this maps a key to a relative event (e.g. a mouse movement). 45 | 46 | ``` 47 | addaction [@keymap] rel 48 | ``` 49 | 50 | when the mapped key is pressed, the relative event fires once with a specified value. 51 | 52 | ### relative constant 53 | 54 | this makes a key trigger a specific relative event constantly until it is released. 55 | 56 | this can be useful for moving the cursor with a keyboard, as an example. 57 | 58 | ``` 59 | addaction [@keymap] relconst 60 | ``` 61 | 62 | `delay` specifies the time between relative events. 63 | 64 | ### absolute 65 | 66 | this maps a key to an absolute event. 67 | 68 | this is not well done at the moment, but eventually it may be used for creating a virtual joystick. 69 | 70 | ``` 71 | addaction [@keymap] abs 72 | ``` 73 | 74 | ### execute 75 | 76 | this action executes a program upon a keypress. 77 | 78 | ``` 79 | addaction [@keymap] execute [args ...] 80 | ``` 81 | 82 | NOTE: `command` in this case is a full path, so don't write `gaming-app`, but instead something like `/usr/bin/gaming-app`. 83 | 84 | ### switch map 85 | 86 | this action switches to a different mapping. 87 | 88 | ``` 89 | addaction [@keymap] switchmap 90 | ``` 91 | 92 | ### shift map 93 | 94 | this action switches to a different mapping until the mapped key is released. 95 | 96 | ``` 97 | addaction [@keymap] shiftmap 98 | ``` 99 | 100 | ### macro 101 | 102 | this action triggers a macro. 103 | 104 | ``` 105 | addaction [@keymap] macro 106 | ``` 107 | 108 | ## example(s) 109 | 110 | ``` 111 | addaction keyboard KEY_UP key KEY_W 112 | addaction keyboard KEY_LEFT key KEY_A 113 | addaction keyboard KEY_DOWN key KEY_S 114 | addaction keyboard KEY_RIGHT key KEY_D 115 | ``` 116 | 117 | this turns the arrow keys into WASD ones. 118 | 119 | ``` 120 | addaction keypad KEY_TAB turbo BTN_LEFT 0.03 0.03 121 | ``` 122 | 123 | this maps the tab key to do very fast left clicks. 124 | 125 | ``` 126 | addaction keyboard KEY_RIGHTSHIFT execute /usr/bin/konsole 127 | ``` 128 | 129 | this opens a terminal on pressing the right shift key. 130 | 131 | ``` 132 | newmap Secondary 133 | addaction keyboard @Secondary KEY_1 key BTN_LEFT 134 | addaction keyboard @Secondary KEY_2 key BTN_MIDDLE 135 | addaction keyboard @Secondary KEY_3 key BTN_RIGHT 136 | addaction keyboard @Secondary KEY_W relconst REL_Y -6 0.02 137 | addaction keyboard @Secondary KEY_A relconst REL_X -6 0.02 138 | addaction keyboard @Secondary KEY_S relconst REL_Y 6 0.02 139 | addaction keyboard @Secondary KEY_D relconst REL_X 6 0.02 140 | addaction keyboard KEY_RIGHTCTRL shiftmap Secondary 141 | ``` 142 | 143 | this makes the right control key turn the left hand side into a mouse as long as it is pressed. 144 | -------------------------------------------------------------------------------- /doc/reference/command/clearactions.md: -------------------------------------------------------------------------------- 1 | # clearactions 2 | 3 | deletes all actions from an event. 4 | 5 | ## usage 6 | 7 | ``` 8 | clearactions [@keymap] 9 | ``` 10 | 11 | if no keymap is specified, the current keymap is altered. 12 | 13 | ## examples 14 | 15 | ``` 16 | clearactions keyboard KEY_TAB 17 | ``` 18 | 19 | this removes the actions assigned to the tab key. 20 | -------------------------------------------------------------------------------- /doc/reference/command/clearmacro.md: -------------------------------------------------------------------------------- 1 | # clearmacro 2 | 3 | deletes the actions in a macro, but keeps the macro. 4 | 5 | ## usage 6 | 7 | ``` 8 | clearmacro 9 | ``` 10 | 11 | ## example(s) 12 | 13 | ``` 14 | clearmacro macro1 15 | ``` 16 | 17 | this clears the macro "macro1". 18 | -------------------------------------------------------------------------------- /doc/reference/command/copyactions.md: -------------------------------------------------------------------------------- 1 | # clearactions 2 | 3 | copies actions from an event to another. 4 | 5 | ## usage 6 | 7 | ``` 8 | copyactions [@keymap] 9 | ``` 10 | 11 | if no keymap is specified, the current keymap is altered. 12 | 13 | ## examples 14 | 15 | ``` 16 | copyactions keyboard KEY_TAB KEY_RIGHTCTRL 17 | ``` 18 | 19 | this copies actions from the tab key to the right control key. 20 | -------------------------------------------------------------------------------- /doc/reference/command/copymacro.md: -------------------------------------------------------------------------------- 1 | # copymacro 2 | 3 | creates a new macro based on a previous one. 4 | 5 | ## usage 6 | 7 | ``` 8 | copymacro 9 | ``` 10 | 11 | ## notes 12 | 13 | two macros can't have the same name. 14 | 15 | ## example(s) 16 | 17 | ``` 18 | copymacro macro1 macro2 19 | ``` 20 | 21 | this copies the macro "macro1" to a new macro called "macro2". 22 | -------------------------------------------------------------------------------- /doc/reference/command/copymap.md: -------------------------------------------------------------------------------- 1 | # copymap 2 | 3 | creates a new mapping based on a previous one. 4 | 5 | ## usage 6 | 7 | ``` 8 | copymap 9 | ``` 10 | 11 | ## notes 12 | 13 | two maps can't have the same name. 14 | 15 | ## example(s) 16 | 17 | ``` 18 | copymap keyboard Secondary Tertiary 19 | ``` 20 | 21 | this creates a new mapping called "Tertiary" with the same keybinds as "Secondary". 22 | -------------------------------------------------------------------------------- /doc/reference/command/copyprofile.md: -------------------------------------------------------------------------------- 1 | # copyprofile 2 | 3 | creates a new profile based on an existing one. 4 | 5 | ## usage 6 | 7 | ``` 8 | copyprofile 9 | ``` 10 | 11 | ## notes 12 | 13 | two profiles can't have the same name. 14 | 15 | ## example(s) 16 | 17 | ``` 18 | copyprofile keyboard Secondary Tertiary 19 | ``` 20 | 21 | this copies the "Secondary" profile to "Tertiary". 22 | -------------------------------------------------------------------------------- /doc/reference/command/delaction.md: -------------------------------------------------------------------------------- 1 | # delaction 2 | 3 | deletes an action from an event. 4 | 5 | ## usage 6 | 7 | ``` 8 | delaction [@keymap] 9 | ``` 10 | 11 | if no keymap is specified, the current keymap is altered. 12 | 13 | ## examples 14 | 15 | ``` 16 | delaction keyboard KEY_TAB 0 17 | ``` 18 | 19 | this removes the first action from the tab key. 20 | -------------------------------------------------------------------------------- /doc/reference/command/delmacro.md: -------------------------------------------------------------------------------- 1 | # delmacro 2 | 3 | deletes a macro. 4 | 5 | ## usage 6 | 7 | ``` 8 | delmacro 9 | ``` 10 | 11 | ## example(s) 12 | 13 | ``` 14 | delmacro macro1 15 | ``` 16 | 17 | this deletes the macro "macro1". 18 | -------------------------------------------------------------------------------- /doc/reference/command/delmacroact.md: -------------------------------------------------------------------------------- 1 | # delmacroact 2 | 3 | deletes an action from a macro. 4 | 5 | ## usage 6 | 7 | ``` 8 | delmacroact 9 | ``` 10 | 11 | ## examples 12 | 13 | ``` 14 | delmacroact macro1 0 15 | ``` 16 | 17 | this removes the first action from the macro "macro1". 18 | -------------------------------------------------------------------------------- /doc/reference/command/delmap.md: -------------------------------------------------------------------------------- 1 | # delmap 2 | 3 | deletes a mapping. 4 | 5 | ## usage 6 | 7 | ``` 8 | delmap 9 | ``` 10 | 11 | ## notes 12 | 13 | this command will fail if you only have a single mapping and you try to delete it. 14 | 15 | ## example(s) 16 | 17 | ``` 18 | delmap keyboard Secondary 19 | ``` 20 | 21 | this deletes the "Secondary" mapping. 22 | -------------------------------------------------------------------------------- /doc/reference/command/delprofile.md: -------------------------------------------------------------------------------- 1 | # delprofile 2 | 3 | deletes a profile. 4 | 5 | ## usage 6 | 7 | ``` 8 | delprofile 9 | ``` 10 | 11 | ## notes 12 | 13 | you can't delete the current profile. 14 | 15 | ## example(s) 16 | 17 | ``` 18 | delprofile keyboard Secondary 19 | ``` 20 | 21 | this deletes the "Secondary" profile. 22 | -------------------------------------------------------------------------------- /doc/reference/command/disable.md: -------------------------------------------------------------------------------- 1 | # disable 2 | 3 | disable keybindings on a device. 4 | 5 | ## usage 6 | 7 | ``` 8 | disable 9 | ``` 10 | 11 | ## examples 12 | 13 | ``` 14 | disable keypad 15 | ``` 16 | -------------------------------------------------------------------------------- /doc/reference/command/enable.md: -------------------------------------------------------------------------------- 1 | # enable 2 | 3 | enable a device, therefore allowing keybinds to work. 4 | 5 | ## usage 6 | 7 | ``` 8 | enable 9 | ``` 10 | 11 | ## notes 12 | 13 | enabling might fail in certain situations. if this is the case, feel free to report a bug. 14 | 15 | ## examples 16 | 17 | ``` 18 | enable keypad 19 | ``` 20 | -------------------------------------------------------------------------------- /doc/reference/command/insmacroact.md: -------------------------------------------------------------------------------- 1 | # insmacroact 2 | 3 | adds an action to a macro. 4 | 5 | ## usage 6 | 7 | ``` 8 | insmacroact ... 9 | ``` 10 | 11 | the command's arguments vary depending on the action type. 12 | these are documented below. 13 | 14 | ## action types 15 | 16 | ### key 17 | 18 | this is a key action. 19 | 20 | value can be: 21 | 22 | - 1: press 23 | - 0: release 24 | 25 | ``` 26 | insmacroact key 27 | ``` 28 | 29 | ### relative 30 | 31 | this is a relative event (e.g. a mouse movement) action. 32 | 33 | ``` 34 | insmacroact rel 35 | ``` 36 | 37 | ### wait 38 | 39 | this waits a specific amount of time before executing the next action. 40 | 41 | ``` 42 | insmacroact wait