Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • josh
    Participant
    Post count: 4

    Using a Save and Load Hotkey
    I have looked up many sources but simply cannot find the answer to my question.
    How can I set up a Save and Load Hotkey using Keyboard Input?
    I know how I might be able to use this with a controller but don’t know how to do it with a keyboard. I am making a product much like the PiGRRL and I am using Adafruit’s Retro Game program to convert the GPIO signals to Keyboard Input. This all works fine for games but I simply can’t get it to work with keyboard hotkeys.
    I tried changing these lines:
    # Saves state.
    #input_save_state = x
    # Loads state.
    #input_load_state = z
    to
    # Saves state.
    input_save_state = x + rshift
    # Loads state.
    input_load_state = z + rshift
    This did not seem to work however. I would be very grateful for a response and will mention the name of who replied in an upcoming blog on how I made my Super Pi Boy…

    Thanks again,
    Josh

    Floob
    Member
    Post count: 1629

    The lines you edited above can only have a single key.

    The hotkey enable would be here:
    input_enable_hotkey =

    So you hold your enable hotkey down then tap the hotkey

    input_save_state = x
    input_enable_hotkey = rshift

    would mean holding Right Shift and tapping x would save the game, assuming no other hotkeys or functions are mapped to x.

    josh
    Participant
    Post count: 4

    Hi Floob,
    Thanks for the quick reply! I have tried this for save but it appears that just RShift alone (Select Button) saves the game and when I used the same code to load the game (changing x to z) nothing happens. No hotkeys are mapped to X however, because we are using the Gameboy buttons, it is not possible to create a dedicated save and load button and all of the buttons are used. Start + Select work fine to exit a game. However, Select (RShift) and A (Z) together don’t work to load the game at all.
    Here’s the code:
    # Saves state.
    input_save_state = x
    input_enable_hotkey = rshift
    # Loads state
    input_load_state = z
    input_enable_hotkey = rshift

    Thanks again,
    Josh

    Floob
    Member
    Post count: 1629

    This line should only exist once in the whole file
    input_enable_hotkey = rshift

    Can you post your retroarch.cfg to pastebin.com and I’ll check it.

    If possible, can you tell me what keyboard keys each of your buttons map to?

    josh
    Participant
    Post count: 4

    Here is my retroarch.cfg file:
    http://pastebin.com/zBByPybD
    My input is as follows:
    Up, Down, Left and Right = The Arrow Keys
    Start = R
    Select = Q
    A = Z
    B = X

    If it matters, I am using the default NES emulator, I don’t know if that would change anything?

    Thanks again,
    Josh
    PS: It had only just occurred to me that I said rshift was select, that was in the Retroarch Config file, not what the actual inputs were through Emulationstation…

    josh
    Participant
    Post count: 4

    Me and my Dad have had another look at the config file.
    Firstly, we were originally editing /opt/retropie/emulators/retroarch/retroarch.cfg however it seems like we were editing the wrong directory…
    This is the correct directory:
    /opt/retropie/configs/all/retroarch.cfg
    These are the lines of code that we used:
    # Saves state.
    input_enable_hotkey = q
    input_save_state = x
    # Loads state.
    input_load_state = z

    My Super Pi Boy project is now complete!
    Also, make sure that you uncomment the input_load_state = z line.

    Thank you so very much Floob for helping me with this issue. I hope that this post will help everyone who needs to overcome this problem.

    Thanks again,
    Josh

    Floob
    Member
    Post count: 1629

    This
    input_enable_hotkey = q

    should read

    input_enable_hotkey = rshift

    on the assumption your arcade stick sends a right shift single on the button you want to use as the enable hotkey.

    Then pressing x on your arcade stick (The A button?) should save the game.

    The hotkey enable for your usb PS3 controller will be held in the controller config file, so that parts separate. /opt/retropie/configs/all/retroarch-joypads/

    Here is a (slightly outdated) video on hotkeys

    Floob
    Member
    Post count: 1629

    Great, glad its sorted. Yes, the correct file is /opt/retropie/configs/all/retroarch.cfg unless you need to edit controller files as well.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.