Well, the chording is in orbotron_translator.h ... the processing is handled in three stages and thus three files.
Basically, orbotron_buffer.h handles processing from the orb and makes an internal model of what the physical orb is doing -- the buttons pressed, etc. So in orbotron_buffer.h, you'll find
void process_magellan_buttondata( void )
if ( crunch_magellan_nibbles() )
physical_buttons = (buffer << 1)
| (buffer << 5)
...which is basically taken from the linux magellan.c driver in magellan_process_packet:
case 'k': /* Button data */
103 if (magellan->idx != 4) return;
104 if (magellan_crunch_nibbles(data, 3)) return;
105 t = (data << 1) | (data << 5) | data;
106 for (i = 0; i < 9; i++) input_report_key(dev, magellan_buttons[i], (t >> i) & 1);
So orbotron_buffer.h handles a model of what the orb is doing. Orbotron_device.h handles the "how it appears to the computer" side of things--in other words, how to send messages to the logical orb that the computer sees. This used to be bigger when we had to handle our own processing of the USB packets, but that's mostly handled by the Arduino Caterina bootloader with a few minor mods.
The filling in the sandwich is orbotron_translator.h. That handles the translation from the model of the physical orb to the computer model. And that's important, because obviously e.g. the orbs don't really have 16 buttons etc. So in orbotron_translator.h you find all the gain and scaling and mapping to buttons and chording and such.
So mapped_buttons is the function that handles the buttons.
unsigned short mapped_buttons( Logical_orbotron& orb )
unsigned short result;
// work chording here
if ( chording )
int chord_page = orb.physical_buttons & 3;
result = ( orb.physical_buttons >> 2 ) << ( 4*chord_page);
result = orb.physical_buttons;// & 63;
So the weird thing is, if you look at process_magellan_buttondata and mapped_buttons if chording is off... well, you're basically reporting what the orb gives. So if the buttons are remapped weirdly--that may be what it's saying. We can add code to make it look more normal, and that's probably a good idea.
As for the axes on the 5000, it's a little weird that it requires a smaller sensitivity, because what SHOULD happen is that the greater sensitivity just firewalls it to the edges faster. So I should take a look at that.
Next set of boards is on order, so even though I'm about out of stock, we'll be back in a bit.