I'm not clear on what you want to do. Is it:
a) an "adapter" that takes numbers typed from a keyboard and translates them to a trackball value to be passed to the computer as a normal trackball (aka mouse).
b) an adapter that takes key presses from a keyboard and translate different keys to different mouse values. Examples: "a" is very fast left, "s" is as little slower left, ... "h" is zero left or right, "j" is slow right, "k" is a little faster right, .... "'" is very fast right.
c) an adapter that takes arrow key presses and translates them to a mouse signal.
d) other?
FWIW, c) can be done in mame or a software driver.
Another FWIW, a) would be hard to type "+126, -25" then press the enter key in the middle of a game.

But this is the only one that I can see as more precise than a normal trackball/mouse input.