@mitu OK I figured it out. Fist i got into Stargate on RetroPie and re-assigned the game controls to different keys using Tab. "Input, this game". F is fire, T is thrust, H is hyperspace, 1 is player1 start, 2 is player2 start, S is smart bomb, I is inviso, R is reverse, arrow up is UP, arrow down is DOWN. This makes my head easier to remember. Then I went back into EmStation, disconnected the USB gamepad and reconfigured the keyboard as main controller. I set key 1 as Start and key 2 as Select. I also set key T as B and key F as A. Down at the bottom of the configure menu I left hotkey blank and when asked, I selected Yes. I also went into RetroArch/Settings/Input/Hotkey Binds and made sure Press Quit Twice is set to OFF. So to exit the game now I press 1 and 2 together and it brings me back to EmStation. And when the Pi is in the cabinet (hooked up to iPac2), I can work through the EmStation using the Stargate control buttons and never need a keyboard or gamepad again.
Alas, I can't help you with that. But if you can't find information about ZDE internals, you could also try to find information about USB HID device specifications in general, as the encoders "just" convert the raw signals to those of a joystick-like USB HID.