[Input] Insert Coin

Hi all, I want to add one feature to menu for insert coin. User can select the count of coin to be inserted. When user select this function, I will generate key event to the core. Just like sample code in input_driver.c

int16_t input_state(unsigned port, unsigned device, unsigned idx, unsigned id) { … if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD))) { bool bind_valid = libretro_input_binds[port] && libretro_input_binds[port][id].valid;

     if (bind_valid || device == RETRO_DEVICE_KEYBOARD)
     {
        rarch_joypad_info_t joypad_info;
        joypad_info.axis_threshold = input_driver_axis_threshold;
        joypad_info.joy_idx        = settings->uints.input_joypad_map[port];
        joypad_info.auto_binds     = input_autoconf_binds[joypad_info.joy_idx];

        if (!reset_state)
        {
           res = current_input->input_state(
                 current_input_data, joypad_info, libretro_input_binds, port, device, idx, id);

#ifdef HAVE_OVERLAY if (input_overlay_is_alive(overlay_ptr) && port == 0) res |= res_overlay; #endif #ifdef HAVE_COIN if ((id == RETROK_RSHIFT) && menu_get_insertcoin()) { res = 1; }
#endif } else res = 0; } } } … }

But it doesn’t work. If anyone have any suggestion, please let me know. Thanks a lot.

Pogo Lin