1583 posts
Location
Germany
Posted 09 April 2015 - 01:01 PM
Well, I had the idea that it would be kinda cool to add "macros" to the keys inside of CC. Now it became a small handy Utility which allows you to modify and/or disable specific events.
Pastebin:
http://pastebin.com/1NDQuiPyThere is not much to say about it, so I'll just give you an example.
Usage
local mapper = dofile("remapper")
mapper.remap({"mouse_click",1,1,1},{"char","a"})
mapper.remap({"mouse_click",1,51,19},{"char","b"})
mapper.remap({"char","c"},{"char","T"})
When you run this code, every click into the upper-left edge of the screen will act like if you "clicked" the "a key".
A mouseclick into lower-right corner will emit a "b" event.
And pressing "c" will emit a "T" event.Methods
- remap(expected_event,remapped_event) // Remap one event to an other event.
- removeMap(expected_event) // Remove the "mapping" for a specific event.
- saveToFile(path) // Save the whole map to a file. if path is not defined, it will use "default.map".
- loadFromFile(path) // Load a map from a file. Look at the above ^.
Edited on 10 April 2015 - 01:11 PM
2427 posts
Location
UK
Posted 09 April 2015 - 04:00 PM
Nice, not sure where I would use this, but I'm sure I will have an idea that will benefit from this.
2679 posts
Location
You will never find me, muhahahahahaha
Posted 09 April 2015 - 04:51 PM
Nice. Is it possible to load these remaps from a file?
2427 posts
Location
UK
Posted 09 April 2015 - 05:31 PM
Nice. Is it possible to load these remaps from a file?
If not then feature request.
2679 posts
Location
You will never find me, muhahahahahaha
Posted 09 April 2015 - 07:26 PM
Nice. Is it possible to load these remaps from a file?
If not then feature request.
Exaclty! #DUH
1583 posts
Location
Germany
Posted 10 April 2015 - 03:08 PM
=======
UPDATE
=======
Now you can load/save the map to a file (if no path is given, "default.map" is used). The pastebin is still the same.
Also I'll add a list of all the methods of this utility/api in the main post.
#EDIT: Done
Edited on 10 April 2015 - 02:21 PM
2679 posts
Location
You will never find me, muhahahahahaha
Posted 10 April 2015 - 03:25 PM
Thanks ;)/>