You can see all the keycodes of your keys,setting keyvalue to all and setting a keyevent.Then press all the keys.
You will get the keycodes of all the keys in decimal.You need to convert them to Hex values and then you can register keyevent for a single key using the hex keyvalue of that key.
Note:-You need to set EnableFunctionkeys_F1 ,F2 and F3 value to 1 in the config.xml to trigger the Keyevent for P1,P2 and P3 keys.
For the triggers you can attach triggerevent.And both the trigger returns triggerflags as 102 and 103.So based on TriggerFlags you can take the decision.
Please let me know if you require any other information.
I just add that, in the settings application, under "Applications", you can find the "Button Remap Program".
With this tool you can see and change the key event associated with left and right trigger plus the P1, P2, P3 soft button.