I found it unwieldy to create the circuitry with just the shift registers (I did try).
I guess it's not a simple as I had imagined.
The following is a summary of considerations for the path forward to adding a trackball to DodoHand.
The DodoHand firmware is large because the DataHand layer scheme is complex.
It's unfortunate that the DodoHand firmware consumes all of Teensy 2.0's available SRAM, leaving no room for the trackball firmware.
The trackball requires continuous monitoring by the controller.
Currently, DodoHand uses the I2C communications protocol to poll the PCA9655E IOE.
The controller is always waiting on I2C, so it has no time to monitor the trackball.
There are two ways to reduce wait time, leaving the controller with enough time to continually monitory the trackball: Interrupts and SPI.
1) InterruptsUsing IOE interrupt is complicated and would consume SRAM that Teesny 2.0 can't spare.
(edited) there is enough power to keep the LEDs on:
26 keys * 20 mA/(2 LEDs in series) = 260 mA < 400 mA total package limit for PCA9655E
All the IR emitters at DigiKey are at least 20mA.
From PCA9655E data sheet
Table 4. DC ELECTRICAL CHARACTERISTICS
6. Each bit must be limited to a maximum of 25 mA and the total package limited to 400 mA due to internal bussing limits.
2) Use SPI protocol to poll IOESPI communications protocol is much faster than I2C, leaving the controller with enough time to continually monitory the trackball.
But changing to an IOE with SPI is complicated because their pins don't have enough power for the optic switches.
Maybe someone could figure out if DataHand uses polling or interrupts by putting a logic analyser on a DataHand.
3) Two controllersYou could use two controllers (this might be the simplest):
* one controller to emulate the DataHand layout
* one controller dedicated to the trackball
Given today's available parts, there is no easy way to make DodoHand with both optic switches and trackball.
4) Hall effect switchesHall effect switches have very low power requirements.
Changing DodoHand to Hall effect switches would make using I2C with interrupts or SPI easier, which would then make adding a trackball simple.
But making Hall effect switches is a long project.
Like invultri said about Hall effect switches, "would have to make a lot of test switches to find a proper setup".
(edited) Changing to Hall effect switches may not be worth the effort.
However, if they are implemented, there are advantages to adding Hall effect switches before the trackball.
Its a lot of work to:
1) add a trackball to DodoHand (because optic-switch power requirements)
2) then change DodoHand switches from optic to Hall effect
DodoHand could be usable sooner, and effort saved, by changing the order of innovation:
1) finish DodoHand using Teensy 2.0 and PCA9655E
2) change DodoHand switches from optic to Hall effect
3) then add a trackball to the DodoHand controller (easy because Hall effect switches have very low power requirements)
(Hall effect sensor information is in Reply #584)
That about sums up the considerations for adding a Trackball to DodoHand. Did I miss something?