key combos for new input code
[libpicofe.git] / common / menu.c
index b4a76cc..6f29f37 100644 (file)
@@ -1055,7 +1055,7 @@ static char *action_binds(int player_idx, int action_mask, int dev_id)
        if (binds == NULL)\r
                return static_buff;\r
 \r
-       count = in_get_dev_bind_count(dev_id);\r
+       count = in_get_dev_info(dev_id, IN_INFO_BIND_COUNT);\r
        for (k = 0; k < count; k++)\r
        {\r
                const char *xname;\r
@@ -1088,7 +1088,7 @@ static int count_bound_keys(int dev_id, int action_mask, int player_idx)
        if (binds == NULL)\r
                return 0;\r
 \r
-       count = in_get_dev_bind_count(dev_id);\r
+       count = in_get_dev_info(dev_id, IN_INFO_BIND_COUNT);\r
        for (k = 0; k < count; k++)\r
        {\r
                if (!(binds[k] & action_mask))\r
@@ -1206,7 +1206,12 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_
                for (is_down = 1; is_down; )\r
                        kc = in_update_keycode(&dev_id, &is_down, -1);\r
 \r
-               unbind = count_bound_keys(dev_id, opts[sel].mask, player_idx) >= 2;\r
+               i = count_bound_keys(dev_id, opts[sel].mask, player_idx);\r
+               unbind = (i > 0);\r
+\r
+               /* allow combos if device supports them */\r
+               if (i == 1 && in_get_dev_info(dev_id, IN_INFO_DOES_COMBOS))\r
+                       unbind = 0;\r
 \r
                in_bind_key(dev_id, kc, opts[sel].mask, unbind);\r
                if (player_idx >= 0) {\r