Thanks very much for the speedy response, I managed to test this morning and your filter suggestion worked

I can see digital inputs appearing when I move the stick and press buttons which is great! I do get double inputs on the stick so I think the debounce setting might need increasing and also I think I only get keypresses for Start and Coin but not the player buttons. I'll double check my cab wiring later just to make sure it's not a physical issue but this is just amazing! Would you mind if I fork your code and have a play around? I've written python based uinput controllers so I can see how the code is working, I'd like to change the inputs to mame defaults too. Also is it possible to add the debounce, fuzz and deadzone settings to the config file?
Edit: just noticed I'm being an idiot, the evtest shows input pressed, input released, not a double press!
You can see I tried jstest in the photo attached, I just get a single analog controller with no digital inputs, is that expected? Also, am I right in thinking this section of code is where the button inputs are being defined, using consecutive numbers from input-event-codes.h?
ioctl(fd, UI_SET_EVBIT, EV_KEY);
for (int i = 0; i < capabilities.switches * capabilities.players; i++)
{
ioctl(fd, UI_SET_KEYBIT, 2 + i);
}
Output of evtest:
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x8371 product 0x3551 version 0x1
Input device name: "SEGA ENTERPRISES,LTD.;I/O 838-13683B ;Ver1.07;99/06"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_

Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 12 (KEY_MINUS)
Event code 13 (KEY_EQUAL)
Event code 14 (KEY_BACKSPACE)
Event code 15 (KEY_TAB)
Event code 16 (KEY_Q)
Event code 17 (KEY_W)
Event code 18 (KEY_E)
Event code 19 (KEY_R)
Event code 20 (KEY_T)
Event code 21 (KEY_Y)
Event code 22 (KEY_U)
Event code 23 (KEY_I)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 16
Min 0
Max 255
Event code 1 (ABS_Y)
Value 16
Min 0
Max 255
Event code 2 (ABS_Z)
Value 16
Min 0
Max 255
Event code 3 (ABS_RX)
Value 16
Min 0
Max 255
Event code 4 (ABS_RY)
Value 16
Min 0
Max 255
Event code 5 (ABS_RZ)
Value 16
Min 0
Max 255
Event code 6 (ABS_THROTTLE)
Value 16
Min 0
Max 255
Event code 7 (ABS_RUDDER)
Value 16
Min 0
Max 255
I have a suspicion I know what is going on, I've tested all player 1 and 2 inputs plus the service and test buttons, here is the only EV_KEY output:
pi@raspberrypi:~ $ sudo evtest --grab /dev/input/event0 | grep EV_KEY
Event type 1 (EV_KEY)
Event: time 1575569148.450595, type 1 (EV_KEY), code 11 (KEY_0), value 1
Event: time 1575569148.599926, type 1 (EV_KEY), code 11 (KEY_0), value 0
Event: time 1575569149.286354, type 1 (EV_KEY), code 10 (KEY_9), value 1
Event: time 1575569149.375928, type 1 (EV_KEY), code 10 (KEY_9), value 0
Event: time 1575569151.973548, type 1 (EV_KEY), code 15 (KEY_TAB), value 1
Event: time 1575569152.092980, type 1 (EV_KEY), code 15 (KEY_TAB), value 0
Event: time 1575569152.449882, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 1
Event: time 1575569152.598522, type 1 (EV_KEY), code 13 (KEY_EQUAL), value 0
Event: time 1575569152.895723, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 1
Event: time 1575569153.014678, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 0
Event: time 1575569153.252335, type 1 (EV_KEY), code 12 (KEY_MINUS), value 1
Event: time 1575569153.341406, type 1 (EV_KEY), code 12 (KEY_MINUS), value 0
Event: time 1575569155.243712, type 1 (EV_KEY), code 17 (KEY_W), value 1
Event: time 1575569155.332949, type 1 (EV_KEY), code 17 (KEY_W), value 0
Event: time 1575569172.043873, type 1 (EV_KEY), code 9 (KEY_

, value 1
Event: time 1575569172.402207, type 1 (EV_KEY), code 9 (KEY_

, value 0
Event: time 1575569173.297450, type 1 (EV_KEY), code 16 (KEY_Q), value 1
Event: time 1575569173.566187, type 1 (EV_KEY), code 16 (KEY_Q), value 0
As you can see all codes from 17->9 are reported which is the second byte of input data of 4 but the others are ignored - if I've read this bit of code right:
for (int i = 0; i < 2 * capabilities.players; i++)
{
for (int j = 7; 0 <= j; j--)
{
emit(fd, EV_KEY, 2 + ( i * 8 ) + j, ( switches[ i ] >> j ) & 0x01);
}
}
I'll keep testing and let you know if I manage to suss where the issue lies