4coder»Forums
Colin
3 posts
Updated Custom Layer Tutorial?
Edited by Colin on Reason: Initial post
I'm new to 4coder, and I'm trying to learn how to rebind keys, but all of the tutorials seem to be out of date. Can anyone direct me to the correct documentation for 4.1?
Simon Anciaux
1337 posts
Updated Custom Layer Tutorial?
I wrote the "Customization layer - getting started" wiki post. Unfortunately I haven't finished updating to 4coder 4.1 so I don't feel confident updating the article yet (or creating a new one as the previous might still be useful to some peoples).

A few pointers:
- The entry point of the custom layer is the "custom_layer_init" function in "custom/4coder_default_bindings.cpp";
- The default bindings are in the "setup_default_mapping" function in "custom/4coder_default_map.cpp";

- So you can create a copy of those two files;
- name them as you wish. For example "4coder_default_bindings.cpp" -> "colin_bindings.cpp" and "4coder_default_map.cpp" -> "colin_map.cpp".
- In colin_bindings.cpp make sure to change the include from "4coder_default_map.cpp" to "colin_map.cpp";
- You can now edit the bindings in "colin_map.cpp".
- To build the custom layer you'll need to pass an argument to the build script "buildsuper_x64.bat colin_bindings.cpp"
- To make that easier you can create a build.bat script in the root folder with this content (assuming Windows 64 bit):
1
2
@echo off
call custom\bin\buildsuper_x64.bat colin_bindings.cpp


Colin
3 posts
Updated Custom Layer Tutorial?
Edited by Colin on
Thanks! I think that'll get me started.

EDIT: So, I made the dll, and copied it in place, but the key bindings were still the default. Instead of including my personal map in my bindings file, I had to make a copy of the default includes file and change the default map include to my map. After doing that, and rebuilding, the bindings worked correctly.
Corentin Godeau
4 posts
French engineering student.
Updated Custom Layer Tutorial?
Hi,

I ran into the same issue yesterday. You also have to set the mapping option in the config file to "" (instead of choose/default/mac-default), otherwise the default mapping is applied.

Hope that helps.
Colin
3 posts
Updated Custom Layer Tutorial?
Ah! Yes. After changing that option in the config file, I don't need to make my own default include file. I can name the setup mapping function something unique, and it works.

Thanks for the help!
Simon Anciaux
1337 posts
Updated Custom Layer Tutorial?
If anyone comes here, the new article Customization layer - getting started ( 4coder 4.1 ) is available.