I think you can achieve this using the Dictionary object and keycodes.
Add keys to the dictionary like this:
Start of Layout
Add key "p1Right" = 39
Add key "p2Right" = 68
Then a loop:
Repeat 3 times
+ On key pressed: keycode Dictionary.Key("p"&LoopIndex&"Right")
+ Character.value("Player") = LoopIndex
Move character right.
I've done this once, I believe it was like this