How to handle gamepad input

I saw Blits in the document Launch can define the global keymap. How to define the mapping of game controllers. For example, DPadUp=>ArrowUp,

you will have to get the DPadUp keycode on the keyup/down eventhandle using a tool like http://keycode.info and map that as a custom key code:
Handling User Input | Lightningjs

Example, if the DPad Up works under keycode 312 (no clue if thats the case) you can set:

keymap: {
   // other keys
  312: DPadUp,
}

Now you should be able to use DPadUp() in your keys. Alternatively you can point it to ArrowUp if that is defined.