@@ 68,15 68,18 @@ controller_init(Controller *ctrl)
static void
controller_button(Controller *ctrl, Uxn *u, Uint8 code)
{
- if(ctrl->raw.curmods & 2)
- return;
-
switch(code) {
+ case 0x39: ctrl->buttons |= 0x01; break; /* a (volume up) */
+ case 0x3a: ctrl->buttons |= 0x02; break; /* b (volume down) */
case 0x12: ctrl->buttons |= 0x10; break; /* up */
case 0x21: ctrl->buttons |= 0x20; break; /* down */
case 0x1f: ctrl->buttons |= 0x40; break; /* left */
case 0x22: ctrl->buttons |= 0x80; break; /* right */
}
+
+ /* arrow keys should not trigger if fn is pressed (says u-boot) */
+ if(ctrl->raw.curmods & 2)
+ ctrl->buttons &= 0x0f;
}
static void