Skip to content

Latest commit

 

History

History
525 lines (454 loc) · 40.5 KB

Readme.org

File metadata and controls

525 lines (454 loc) · 40.5 KB

Readme

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.

Table of contents

About this Repository

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.

License

Images are CC-BY-SA licensed.

Building guide

Needed items

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.

Parts

Consumables

  • 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

Tools

  • 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

(optional) Enhance the 3D printed case

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. images/after-prime.jpg images/after-paint.jpg These images are from another build, so don’t be confused. For this guide I opted for some half transparent cases instead.

Wiring & Mounting

Try mounting the USB-C female to male cable and the TRS socket.

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.

Wiring diagrams

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+--+-------+       |   |         |   |
                |              +-------------------+  |               |   +---------+   |
                |                                     +---------------+                 |
                |                                                                       |
                |                                                                       |
                +- ---------------------------------------------------------------------+


Solder the diodes and LEDs on.

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. images/PCB-diode-direction.jpg 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.) images/RGB_LED_detail.jpg images/LED_GND_PAD_detail.jpg

A short note about soldering electronics

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.

Solder the Amoeba Kings

Further detailed details about the wiring of Amoeba Kings can be found here.

RGB LEDS

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: images/amoeba_rgbled_gnd_pad.jpg

Diodes

Since this keyboard is wired with column to row diodes, the thin line on the LED housing needs to be at this side: images/amoeba_diode_direction.jpg

Solder the pin headers onto the PCBs and the RP2040

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)

Solder the switches to the PCB

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.

Solder the roller encoders

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. images/encoder1.jpg images/encoder2.jpg

Solder the jumper wires between the TRRS socket and the RP2040.

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.

Solder the PMW3360 trackball sensor

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. images/solder_pmw.jpg images/pmw_plastic_lense.jpg

Mount the ball bearings for the trackball.

If using transfer units

This is very easy. Just press the transfer units into their sockets in the case.

If using ball bearings

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. images/bearings-in.jpg

Mount the insert nuts

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:images/insert_prepare.jpg

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. images/inserts.jpg

Mount the M2 insert nuts

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: images/pmw_prepare.jpg

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. images/pmw_in.jpg Again, let the glue dry and then remove the screws and the sensor again.

wiring the amoeba kings

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: images/amoeba_switch_to_pad.jpg

Wiring diagrams

Left side

images/amoeba_wiring_left.jpg

Right side

images/amoeba_wiring_right.jpg

Putting everything together

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: images/done.jpg

Wiring the USB Plugs

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: images/usb-check-conti.jpg Each wire that has continuity must be soldered to the wire of the plug. images/usb-done.jpg

Flashing the firmware

Preparing the QMK firmware

Setting up QMK

Set up QMK for your operating system. Here is the offical instructions.

Gentoo

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.

Linux

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

Customizing your key map

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.

OPTION 1: the hardcore way with a text editor

Key layout

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.)

Special key codes in this firmware
The firmware also has some additional keycodes which you can use in the matrix above like any other keycode.
KeycodeShort aliasFunction
POINTER_DEFAULT_DPI_FORWARDDPI_MODIncrease the sensitivity in cursor mode / decrease it when shift is pressed
POINTER_DEFAULT_DPI_REVERSEDPI_RMODDecrease the sensitivity in cursor mode / increase it when shift is pressed
POINTER_SNIPING_DPI_FORWARDS_D_MODIncrease the sensitivity in sniping mode / decrease it when shift is pressed
POINTER_SNIPING_DPI_REVERSES_D_RMODDecrease the sensitivity in sniping mode / increase it when shift is pressed
SNIPING_MODESNIPINGActivates sniping mode while key is pressed
SNIPING_MODE_TOGGLESNP_TOGToggles sniping mode
DRAGSCROLL_MODEDRGSCRLActivates dragscroll mode while key is pressed
DRAGSCROLL_MODE_TOGGLEDRG_TOGToggles dragscroll mode
Layers

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.

Using QMK Configurator for similar keyboard

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.

Other things to set in the firmware

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.

#define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200

The minimum sensitivity in default mode.

#define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 200

Change of the sensitivity in cursor mode each time POINTER_DEFAULT_DPI_FORWARD/ REVERSE is pressed.

#define CHARYBDIS_MINIMUM_SNIPING_DPI 400

The sensitivity in sniping mode.

#define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200

Change of the pointers sensitivity in sniping mode each time POINTER_SNIPING_DPI_FORWARD/ REVERSE is pressed.

#define CHARYBDIS_POINTER_ACCELERATION_ENABLE

Enable pointer acceleration.

#define CHARYBDIS_POINTER_ACCELERATION_FACTOR 24

Amount of pointer acceleration.

Compiling your firmware

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 the compiled .uf2 file.

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’.

Bringing the RP2040 into flashing mode the first time

When flashing an RP2040 the first time, you bring them into bootloader mode by holding the BOOT switch while plugging the usb in.

Bringing the RP2040 into flashing mode when it was flashed with qmk before

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.