WIP! WIP! I will update this while builing this thing. WIP!
This is a Dactyl Manuform with a trackball in its right thumb cluster, a Tractyl Manuform so to speak. It uses a RaspberryPi RP2040 as this MCU gives a good mix of power, availability and reliability Features:
- Trackball (duh)
- Per key RGB LED
- Uses a flexible PCB I designed
- Two LED dotmatrix screens
- Roller encoders
If you follow this guide to build it, you can skip several features if you want to.
- About this Repository
- Building guide
- Needed items
- (optional) Enhance the 3D printed case
- Wiring & Mounting
- Try mounting the USB-C female to male cable and the TRS socket.
- Wiring diagrams
- Solder the diodes and LEDs on.
- Solder the Amoeba Kings
- Solder the pin headers onto the PCBs and the RP2040
- Solder the switches to the PCB
- Solder the roller encoders
- Solder the jumper wires between the TRRS socket and the RP2040.
- Solder the PMW3360 trackball sensor
- Mount the ball bearings for the trackball.
- Mount the insert nuts
- Mount the M2 insert nuts
- wiring the amoeba kings
- Putting everything together
- Wiring the USB Plugs
- Flashing the firmware
The idea and some models come from Reddit user u/qqurn. Check out his Gitlab repository here.
After writing my first guide on building tracktyls I also built an enhanced version that should have had everything:
- Per key RGB
- Big screen
- Small screen
- Roller encoders
- Trackball
- USB HUB
However, while building it, it came to me that I could never write a guide on it, because it required way to much hackery and superglue. It was all way too much stuff crammed into that small housing and I do not want to actually guide people to doing botchery. I figured that the problem here was that everything is wired together using single wires and glued in place. (The RGB LEDs mainly.) We need a circuit board!
I therefore designed one and let it made. Anyone interested can buy it on here on ebay. They require the builders to do some SMD soldering themselves, though. Maybe I will do some pre-fabricated ones in the future.
Images are CC-BY-SA licensed.
I apologize if most of these parts are from German ebay vendors, but this is where I got them from. I am sure you can find them from somewhere else. I list the exact amount of parts needed, for some things it makes sense to have some spare, like switches, diodes, jumper wires, ball bearings, etc. Many of the parts come in packages of a 100 or so, so you have some spares anyway.
- 3D printed case. A few models can be found in the folder models, but most 5x6 Tractyl Models should work with the flexible PCB. You can also create new ones using this generator or you can buy them directly from their shop. The ones in this repository are mode using the generator on standard settings for the distance of keys. (Important for the PCB). Also a friend of mine sometimes print and sells them if he is in the mood.
- 62 keyboard switches. Any of the usual Cherry style switches will work. Cherry, Kailh, Gateron, you name it. Better order a few extra, like 70 or so.
- 2 flexible PCBs
- 10 Amoeba Kings
- 62 1N4148 Diodes in SOD-123 form. E.g. those. (definitely buy some extra of those, they break easily when hand soldered)
- 62 SK6812 MINI-E RGB LEDs. E.g. those. (people report they also easily break from heat while soldering, but none ever broke for me)
- 1 USB-C to USB-A cable. Or USB-C to USB-C. Or however you want to connect the keyboard to your computer.
- 2 RaspberryPi Pico RP2040 or clones of them. E.g. those. To fit them with the USB-C female to male cables (up next) make sure to get some in with USB-C connector.
- 2 Roller encoders (if anyone has a better source, let me know)
- 2 SSD1306 Displays
- 2 USB-C plugs / or those (4 PIN)
- 1 USB-C male to male cable, CMST-CMST (10cm)
- 1 TRRS 3,5mm cable. (Note: It’s TRRS (Plug has three black rings) not TRS)
- 2 TRRS 3.5mm sockets. (Note: It’s TRRS not TRS)
- ~40 Jumper wires. Female-Female. In most cases 10cm is sufficient, but buy some 20cm, too.
- 8 jumper wires Male-Female
- ~40 straight pin headers, single row, 2.54mm distance
- ~40 90 degree pin headers, single row, 2.54mm distance
- 14 M3x4 insert nuts.
- 4 M2x3 insert nuts.
- 14 screws M3x6.
- 4 screws M2x8. These are for mounting the PMW3360 sensor. Make sure you buy some with a small head, like the ones in the link.
- Some bumper pads to prevent the keyboard from slipping all over the place.
- 1 PMW3360 Motion Sensor
- if using a model with ball transfer units:
- if using a model with ball bearings:
- 3 MR63ZZ ball bearings
- 3 3mm (diameter) pins. I bought them in 10mm length and cut them off, because I could not find anything shorter. You need about 7mm long ones actually.
- 1 34mm trackball.
- Some key caps you like with cherry mount. (the plus shaped stem, nearly all of them have cherry mounts) I personally prefer SA sculpted key caps with Dactyls although for someone who uses Dvorak a set that has everything (Dvorak and Dactyl special keys) is hard to get.
- wire, you can wire this however you like. I use insulated wire with 0.5mm diameter
- thin wire (0.38mm) for the Amoeba Kings
- solder, it depends on personal preference, but I used solder with 1mm diameter (Also for SMD, I don’t mind) Don’t be cheap on solder, often enough a successful solder job depends mostly on proper solder.
- flux certainly helps for SMD soldering
- some shrinking tube
- (optional) filler
- (optional) some spray paint you like
- soldering iron
- maybe 3D printer if you print yourself
- multi meter (to check for continuity, a cheap one is enough if you don’t want to use it for different things later on)
- small Phillips screwdriver
- small hex keys for the screws
- nose pliers
- wire cutters
- metal saw
- electric drill
- (maybe) some files if your 3D print is not of good quality
This step is completely optional and there are many ways of enhancing a 3D print out there, but I wanted to share this regardless. Just in case you are not that much into 3D printing there is maybe some new stuff here for you. So what I found very effective to increase the surface quality of 3D prints is filler that is spray-able. (not filler paint, it is even thicker than that.) I sand the 3D print with approx. 120 grit sandpaper before, just to make the surface a little bit smoother. Then I spray the primer on for the first time. Spray it very thin. It should not be soaking wet, because then in takes ages to dry. If it is thin enough it will be dry in 5 minutes. Then I sand the surface with 120 grit again. I don’t sand it too much but against the ‘grain’, so that the ‘hills’ are sanded off but the filler stays in the ‘valleys’. Then I spray on some filler again, wait 5 minutes and sand again. I do this 3-4 times, after that I spray filler again, but this time a bit thicker and then let it dry over night. This will give you a flat surface, where you can not see the the 3D print layers anymore. To get an ever better really shiny flat surface additional steps are needed of course, but this is a plastic casing of a keyboard, not a piano after all. After that procedure I paint the case with normal paint from the hardware store. I think there are enough videos and tutorials on how to use spraying cans, so I won’t get into that. These images are from another build, so don’t be confused. For this guide I opted for some half transparent cases instead.
It could be that they don’t fit, especially if you primed and painted the case. If they don’t fit, use a round file to widen the holes a bit. Do this first because it could be that the file ruins your paint and you have to paint that particular part again. You don’t want to paint this again when the switches and everything is mounted that’s why we do this as a first step.
This is the wiring diagram for the right and the left half.
RP2040 left +-------------------+ +------------------------------+GP0 +-----+ VBUS+-------------------------+ | +--------------------------+GP1 | USB | VSYS| +---------------+---+ | | +-----------+ |GND +-----+ GND+---------| +-LED5V | | | | |OLED SDA+-----------+GP2 3V3_EN| | | | | | |Display SCL+-----------+GP3 3V3_OUT+--------+-----+------+ | | | | | GND+-----+ ROW0|GP4 ADC_VREF| | | | | | | | 3V3+--+ | ROW1|GP5 GP28+--------+ | | | | | +-----------+ | +-----+GND GND|Encoder Root | | | | | | ROW2|GP6 GP27|Encoder A | | | | | | ROW3|GP7 GP26|Encoder B | | | | | | ROW4|GP8 RUN| | | | | | | ROW5|GP9 GP22|Reset switch-+ | | | | | | |GND GND+-------------+ | | | | | | COL0|GP10 GP21|LEDIN | | | | | | COL1|GP11 GP20| | | | | | | COL2|GP12 GP19| | | | | | | COL3|GP13 GP18| | | | | | | |GND GND|LEDGND | | | | | | COL4|GP14 GP17| | | | | | | COL5|GP15 GP16| | | | | | | +-------------------+ | | | | | | | | | | | | | | | | | +--------------------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +---------------------+ | | | | | | | RP2040 right | +----------------------+ | | +-------------------+ | | +---+--------------------------+GP0 +-----+ VBUS| | | +--------------------------+GP1 | USB | VSYS|---+ | +-----------+ |GND +-----+ GND|------+ +-LED5V |OLED SDA+------------------+GP2 3V3_EN| | |Display SCL+------------------+GP3 3V3_OUT+---------------+--+-----------------+ | GND+---------+ ROW0|GP4 ADC_VREF| | | | 3V3+---+ | ROW1|GP5 GP28|--+ | | +-----------+ | +--------+GND GND|--+ | | | ROW2|GP6 GP27|Encoder A | | | ROW3|GP7 GP26|Encoder B | | | ROW4|GP8 RUN| | | | ROW5|GP9 GP22|Reset switch-+ | PMW3360 | | Enc Root|GND GND|-------------+ | +---------+ | | COL0|GP10 GP21|LEDIN +------+ VCC | | | COL1|GP11 GP20| +-----------+ MIS | | | COL2|GP12 GP19+----------+-----------+ MOS | | | COL3|GP13 GP18+----------+-----------+ SCL | | | LEDGND|GND GND|--+ +---+-----------+ SS | | | COL4|GP14 GP17+--+---+ | +---+ GND | | | COL5|GP15 GP16+--+-------+ | | | | | +-------------------+ | | +---------+ | | +---------------+ | | | | | +- ---------------------------------------------------------------------+
The T4 housing of the diodes usually has a thin line, this is the cathode. The line must be on the side the diode symbol on the PCB is pointing to. The RGB LEDS have one slightly slanted leg. This goes at the pad with the little white triangle. Also mount them facing with the light towards the PCB. (So upside down so to speak.)
Unlike the switches, the wires or the TRS socket for example, which are quite sturdy, small electronic boards are a bit more sensitive. You can fry them with the soldering iron. Try to put as few heat as possible into the chips. You can do this by putting the solder on the soldering iron first, then touching the place you want to solder just long enough for everything to heat up enough so the solder can flow into its place. The art here is to just put enough heat into this (if you don’t have a soldering iron with a heat setting like me, read “touch the thing you want to solder long enough” here) so that the solder flows where it should, does not form a ball and covers the pad on the pin completely.
Further detailed details about the wiring of Amoeba Kings can be found here.
The RGB LEDS actually are not that different to solder to the ones on the flexible boards. The slanted leg goes where the blue arrow points at. The red arrows indicates the diode direction:
Since this keyboard is wired with column to row diodes, the thin line on the LED housing needs to be at this side:
I used straight pin headers here for the PCB which I later bent, although I would recommend to use 90 degree angled pin headers or solder the wires directly. (If so, use jumper wires where one side is cut off to connect them to the RP2040 later on)
Depending on the model and the quality of the 3D print this can be a little finicky. I would recommend to start with the switch in the middle, put it in the case, and solder the PCB an from the underside. Then work your way outwards in the way of a column. If a switch really does not want to be soldered, cut the plastic legs off. This helps by a lot. But make sure the switch can still move in the housing.
The roller encoders have three relevant connectors for us, which are the three pins that have wires connected to them. The connectors in the middle is the encoder root, which gets later connected to ground. Make sure to insulate everything well with shrinking tube. Its best to solder the wires on (I used jumper wires which I cut one side off of, to connect them to the RP2040 easily later) then stickt them to the small holder plates. It is a good idea to take a photos of that to remember which wire is the root contact.
On the TRRS socket it does not really matter which pin you use, as long as the same wire goes to the same pin on the other side. However, use the sleeve for the ground at least, it is usually the one that is on the outside of the socket. I tend to use tip for the voltage and the rings for communication, but that is entirely up to you.
In those pictures I used jumper wires with male ends, but this wont work on many models, because the clearance to the bottom plate is not big enough. So rather use 90 degree angled pin headers or solder the wires directly to the board. If using jumper wires you can solder the male ends in, then cut them off on the other side. Make sure to cut them off low enough so the plastic lens thingy still fits.
This is very easy. Just press the transfer units into their sockets in the case.
If you bought pins for the bearings that are too long, put the bearing on the pin before sawing it off. Otherwise you could have problems putting the pins in when they are serrated from the vice or saw. Those small bearings are a very sensible part, don’t make loud noises and let them sniff your hand before touching them. Just kidding, just don’t put them in the vice and don’t put a force on the inner ring without putting the same force on the outer ring. Once you have the pins in the right length, just press them into the recesses. PLA is rather soft, so they stick in there, make some room with the soldering iron in case they don’t go in. Once they are in you can correct their position, which determines the height of the ball and the distance between the PMW3360 and the ball by heating them up with the soldering iron. Try to get the ball down as far as possible without it touching the case.
Mounting those nuts is easy if you found nuts that are big enough for the holes. You put them on your soldering iron, heat them up, then press them into the 3D print. Just make sure your soldering iron is clean from solder, otherwise solder will block the thread and screws wont go in easily. If you could not find nuts that are big enough, glue them in. Here is a trick how to get them in the right position: Pre-mount them on the bottom plate with a screw, like this:
Then put some glue on the insert nuts. Then mount the bottom plate into place, wait until the glue has dried and them remove the screws. Try to only put glue on the outside and use glue that is somewhat viscous so the glue wont flow into the inside from the bottom up and block the screw.
The M2 inserts and screws are for the PMW3360 sensor, the display lids and the mounts of the roller encoders. Here you can mount them again to the PMW3360:
Then you can glue them in. Note that the PMW must be mounted with the terminal holes up. (Down in this picture since the keyboard is upside down) Make sure that the plastic lens that comes with the PMW lies on that surface as flat as it can get, otherwise the ball will be too far away from it. Again, let the glue dry and then remove the screws and the sensor again.
Since the space inside the housing is limited I would recommend to wire the Amoeba Kings up outside first, then putting them in there. What worked best for me is to first cut the thin 0.38mm wires into the right length, then put a drop of solder on the iron, with that and a very hot soldering iron dab the ends of the wires into that drop of liquid solder. This burns off the insulation and also puts solder on the wire making it easier to solder to the Amoeba King. To mount the Amoeba Kings I did not use hot swaps but rather just bridged the gap between the switch pin and the pad with a little piece of wire:
Before putting everything together, test the setup first. Connection problems are way easier to fix when the parts are not mounted yet. So continue with the firmware guide below before mounting everything. Here is the thing in all its glory:
Cut the USB male to male cable in half, separate the wires and strip them a few millimeters. Now plug the cable into the USB plugs like this and measure continuity: Each wire that has continuity must be soldered to the wire of the plug.
Set up QMK for your operating system. Here is the offical instructions.
For Gentoo Linux I made a little guide, since the official instructions do not work very well. Skip this part and stick to the official instructions above if you do not run Gentoo.
Then run these commands:
# install dependencies
sudo emerge dev-vcs/git dev-python/pip
Gentoo now does not allow to install packages that are not provided by Gentoo into the systems Python environment. For that is has a mechanism called virtual environments. We need to create one of those and install qmk in there:
python -m venv /path/to/venv
. /path/to/venv/bin/activate
pip install qmk
To build the toolchain for compiling for the RP2040 ARM processor:
sudo crossdev --stable --target arm-none-eabi --env 'EXTRA_ECONF="--with-multilib-list=rmprofile"'
Don’t bother to run qmk setup
like the official guide tells you to.
Continue with the guide with topic Linux below.
This probably works well for Windows and Mac, too. I do not know as I haven’t tried.
# clone and prepare the QMK-Firmware repo
git clone https://github.com/qmk/qmk_firmware.git
cd qmk_firmware_dm_r_track/
make git-submodule
# to test if your toolchain works, compile something:
qmk compile -kb handwired/dactyl_manuform/5x6 -km default
If the compilation succeeds it will output
Linking: .build/handwired_dactyl_manuform_5x6_default.elf [OK]
Creating load file for flashing: .build/handwired_dactyl_manuform_5x6_default.hex [OK]
Copying handwired_dactyl_manuform_5x6_default.hex to qmk_firmware folder [OK]
Checking file size of handwired_dactyl_manuform_5x6_default.hex [OK]
* The firmware size is fine - 19456/28672 (67%, 9216 bytes free)
And you will now have the file handwired_dactyl_manuform_5x6_default.hex
in the qmk_firmware_dm_r_track folder. Delete it.
rm handwired_dactyl_manuform_5x6_default.hex
You can use the standard layout as a base.
Inside your qmk_firmware_dm_r_track folder there is a folder with the key maps for the Tractyl under keymaps/handwired/tractyl_manuform/5x6_right/keymaps
.
This folder contains sub folders with custom sets of key maps. Now you have two choices:
- Edit one of the existing key maps
- Make your own key map. Copy one of the folders in
keymaps/handwired/tractyl_manuform/5x6_right/keymaps
in place and rename it to your liking.
Either way you will find a keymap.c
file inside of those folders. This file is compiled into the actual part of the firmware that determines the keymap. Inside there is a part that looks something like this:
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_COLEMAKDHM] = LAYOUT_5x6_right(
DM_REC1, DM_REC1, DM_PLY1, DM_REC2 , DM_PLY2 , DM_RSTP, KC_CPI_DOWN, KC_CPI_STD , KC_CPI_UP , KC_SMO_SC , KC_0 ,KC_QUOT_MY,
KC_TAB, KC_Q , KC_W , KC_F , KC_P , KC_B , KC_J , KC_L , KC_U , KC_Y , KC_SCLN_INV ,KC_QUOT_MY,
KC_ESC, KC_A , KC_R , KC_S , KC_T , KC_G , KC_M , KC_N , KC_E , KC_I , KC_O ,KC_MINS,
KC_TILD_MY, KC_Z , KC_X , KC_C , KC_D , KC_V , KC_K , KC_H , KC_COMM , KC_DOT , KC_SLSH ,KC_BSLASH,
_______, _______, _______, KC_LGUI,
TD(SFT_TM), TD(RAI_TM), _______, KC_SPC,
TD(CTL_TM), TD(GUI_TM), _______, KC_ENT,
TD(ALT_TM), TD(LOW_TM), KC_BSPC, KC_DEL
),
[_LOWER] = LAYOUT_5x6_right(
KC_TILD, KC_EXLM , KC_AT , KC_HASH , KC_DLR ,KC_PERC, KC_CIRC, KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______,
_______, KC_PGDN , KC_HOME , KC_END , KC_PGUP ,_______, _______, _______ , RALT(KC_Y) , _______ , RALT(LSFT(KC_SCLN)) , _______,
_______, RALT(KC_Q) , _______ ,RALT(KC_S) , KC_RBRC ,_______, KC_BTN3, KC_BTN1 , RALT(KC_5) , KC_BTN2 , RALT(KC_P), _______,
KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
_______,_______, _______,_______,
_______,_______, _______,_______,
_______,_______, _______,_______,
_______,_______, _______,_______
),
[_RAISE] = LAYOUT_5x6_right(
_______, _______ , _______ , _______ , _______ ,_______, _______, _______ , _______ , _______ , _______ , _______,
_______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_QUOT,
_______, KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC ,KC_LBRC, KC_RBRC, LSFT(KC_LBRC),LSFT(KC_RBRC) ,LSFT(KC_COMM),LSFT(KC_DOT) ,KC_MS_BTN3,
KC_TILD, KC_EXLM , KC_AT , KC_HASH , KC_DLR ,KC_PERC, KC_CIRC, KC_AMPR , KC_ASTR , KC_PLUS , KC_EQL , KC_DEL,
_______,_______, _______,_______,
_______,_______, _______,_______,
_______,_______, _______,_______,
_______,_______, _______,_______
),
};
This represents the layout of the keys. In order to change a key, you have to exchange the keycode of that key with the one you want. Say you want to have escape on the first key in the second row. Then you would exchange KC_TAB
there with KC_ESC
. If you do not know the keycode of a key, you could use QMK Configurator. When you hover your mouse over a key in the keyboard image on the bottom of a page, it shows you the keys keycode in a bar a the bottom.
To get special key functions like RALT(KC_Y)
you can see them in the same way on the bottom in the “Quantum” tab.
Here is also a reference for the keycodes used by QMK. There are a few.
Please note that you can not change the amount of different keycodes or the firmware will not compile. You should also not alter the overall layout. (do not remove commas etc.)
Keycode | Short alias | Function |
---|---|---|
POINTER_DEFAULT_DPI_FORWARD | DPI_MOD | Increase the sensitivity in cursor mode / decrease it when shift is pressed |
POINTER_DEFAULT_DPI_REVERSE | DPI_RMOD | Decrease the sensitivity in cursor mode / increase it when shift is pressed |
POINTER_SNIPING_DPI_FORWARD | S_D_MOD | Increase the sensitivity in sniping mode / decrease it when shift is pressed |
POINTER_SNIPING_DPI_REVERSE | S_D_RMOD | Decrease the sensitivity in sniping mode / increase it when shift is pressed |
SNIPING_MODE | SNIPING | Activates sniping mode while key is pressed |
SNIPING_MODE_TOGGLE | SNP_TOG | Toggles sniping mode |
DRAGSCROLL_MODE | DRGSCRL | Activates dragscroll mode while key is pressed |
DRAGSCROLL_MODE_TOGGLE | DRG_TOG | Toggles dragscroll mode |
In the above example [_COLEMAKDHM], [_LOWER] and [_RAISE] are the names of the layers. You can put in any name for the _COLEMAKDHM layer, but you have to change the enum at the beginning of the file accordingly.
enum custom_layers {
_COLEMAKDHM,
_LOWER,
_RAISE,
};
You better leave the RAISE and LOWER name like they are. You could change them, but you would have to change them everywhere in the file.
To add another layer, copy and past one of the existing layers, rename it to whatever you like, e.g. _MYLAYER. Then add a new line with that name to the enum.
You bind your layer to a key with the keycode MO(_MYLAYER)
. MO switches a layer on like the shift, CTRL etc. keys. So when you hold that key down, the layer is active. When you let go, the layer is not active. Again there are several other layer functions like TG()
which toggles a layer. Look them up in QMK Configurator.
Because editing the keycodes is somewhat tedious, I came up with a way to utilize QMK Configurator a bit for it. Go to QMK Configurator and select the handwired/tractyl_manuform/5x6_right/teensy2pp keyboard. Rename the keyboard to whatever you like and edit your keyboard to your liking. Be aware that you can not put in the custom keycodes to modify the modes of the trackball. For now give the key that should activate a trackball mode later some special keycodes so you can easily distinguish them from the others.
When you are done, export the key map as JSON and put it into the qmk_firmware folder. Then run the command
qmk json-keymap handwired-dactyl_manuform-5x6-yourfilename.json >> mykeymap.c
#or
qmk json2c handwired-dactyl_manuform-5x6-yourfilename.json >> mykeymap.c # depending on qmk version.
With “yourfilename” changed to your actual filename of course. This will generate a C source file with the name mykeymap.c out of the JSON file. It will look something like this:
#include QMK_KEYBOARD_H
/* THIS FILE WAS GENERATED!
*
* This file was generated by qmk-compile-json. You may or may not want to
* edit it directly.
*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_5x6_right(KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSLS, KC_LBRC, KC_RBRC, KC_PGUP, KC_PGDN, KC_LSFT, KC_NO, KC_NO, KC_RSFT, KC_LCTL, KC_SPC, KC_RALT, KC_LALT, MO(1), KC_ENT, LGUI_T(KC_RGUI)),
[1] = LAYOUT_5x6_right(KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, RCS(KC_2), KC_F9, KC_F10, LSFT(KC_F7), LCTL(KC_R), KC_LCBR, KC_RCBR, KC_HOME, KC_INS, KC_F11, KC_F12, KC_PLUS, KC_TRNS, RCS(KC_3), RCS(KC_4), MO(2), KC_DEL, KC_LPRN, KC_RPRN, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_PIPE, KC_CAPS, LSFT(KC_F8), LSFT(KC_F9), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_EQL, RCS(KC_3), RCS(KC_4), LSFT(KC_F8), LSFT(KC_F9), RCS(KC_2), LCTL(KC_F2), LCTL(KC_F3), KC_PSCR, KC_END, KC_LSFT, KC_TRNS, KC_TRNS, KC_RSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
[2] = LAYOUT_5x6_right(KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_VOLD, KC_TRNS, KC_PDOT, KC_COMM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
};
Where 0, 1 and 2 are the different layers. While this is horrible to read of course, these layers are perfectly valid key maps. But you have to make some changes first before you can use it in the Tractyls firmware. First of all, copy only the part that says
LAYOUT_5x6_right(KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_BSLS, KC_LBRC, KC_RBRC, KC_PGUP, KC_PGDN, KC_LSFT, KC_NO, KC_NO, KC_RSFT, KC_LCTL, KC_SPC, KC_RALT, KC_LALT, MO(1), KC_ENT, LGUI_T(KC_RGUI)),
into an existing Tractyl layouts keymap.c
. So you will not mess up the names of the layers.
Now exchange the keycodes that should modify the trackball modes with the custom keycodes from above.
If you haven’t yet, you can create the file keyboards/handwired/tractyl_manuform/5x6_right/keymaps/yourkeymap/config.h
. In it you can put the following lines to change the behavior of your keyboard.
The minimum sensitivity in default mode.
Change of the sensitivity in cursor mode each time POINTER_DEFAULT_DPI_FORWARD/ REVERSE is pressed.
The sensitivity in sniping mode.
Change of the pointers sensitivity in sniping mode each time POINTER_SNIPING_DPI_FORWARD/ REVERSE is pressed.
Enable pointer acceleration.
Amount of pointer acceleration.
Once you are done with setting up the keymap to your liking, you can generate a .hex file with the command
qmk compile -kb handwired/Tractyl_manuform/5x6_right/rpi2040 -km <name_of_your_keymap>
while being inside the qmk_firmware folder. If you haven’t screwed up your keymap.c from before, this will generate a .uf2-file in the qmk_firmware folder.
You can also do
qmk compile -kb handwired/Tractyl_manuform/5x6_right/rpi2040 -km <name_of_your_keymap>
to compile and flash in one go.
Flashing is very straightforward on the RP2040. Bring the RP2040 into bootloader mode then it will show up like an usb stick on the PC. Then copy the .uf2 file from the step before onto that ‘USB stick’.
When flashing an RP2040 the first time, you bring them into bootloader mode by holding the BOOT switch while plugging the usb in.
Bring the RP2040 into bootloader mode by double tapping the RST switch. There are also several other ways, e.g. connect pin GP22 to ground twice in one second. Or hold down the upper left key on the left half or the upper right key on the right half while plugging the USB in.